submodule_roll: Move timeout value to the entry
Bug: b/341756093
Change-Id: Ibb03976f55a8bf6fb034e03eb8515ad7ffb012b0
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/236692
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Rob Mohr <mohrr@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
diff --git a/recipe_modules/submodule_roll/api.py b/recipe_modules/submodule_roll/api.py
index f465c4b..5755346 100644
--- a/recipe_modules/submodule_roll/api.py
+++ b/recipe_modules/submodule_roll/api.py
@@ -56,11 +56,12 @@
checkout: checkout_api.CheckoutContext,
path: config_types.Path,
new_revision: str,
+ submodule_timeout_sec: int,
) -> RevisionChange:
with self.m.context(cwd=checkout.top):
self.m.git.submodule_update(
paths=(path,),
- timeout=checkout.options.submodule_timeout_sec,
+ timeout=submodule_timeout_sec,
)
old_revision = self.m.checkout.get_revision(
@@ -143,6 +144,7 @@
checkout,
submodule.dir,
new_revision,
+ submodule_entry.timeout_sec or 10 * 60,
)
try:
diff --git a/recipe_modules/submodule_roll/submodule.proto b/recipe_modules/submodule_roll/submodule.proto
index 8a3b523..5d01475 100644
--- a/recipe_modules/submodule_roll/submodule.proto
+++ b/recipe_modules/submodule_roll/submodule.proto
@@ -26,4 +26,7 @@
// Branch to track. By default retrieved from .gitmodules or "main".
string branch = 3;
+
+ // Timeout for 'git submodule update'. Default: 10 minutes.
+ int32 timeout_sec = 4;
}
diff --git a/recipe_modules/submodule_roll/tests/full.expected/noop.json b/recipe_modules/submodule_roll/tests/full.expected/noop.json
index 0151095..2e63a49 100644
--- a/recipe_modules/submodule_roll/tests/full.expected/noop.json
+++ b/recipe_modules/submodule_roll/tests/full.expected/noop.json
@@ -53,6 +53,7 @@
],
"cwd": "[START_DIR]/checkout",
"name": "b2.git submodule update",
+ "timeout": 600,
"~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@"
]
diff --git a/recipe_modules/submodule_roll/tests/full.expected/success.json b/recipe_modules/submodule_roll/tests/full.expected/success.json
index bf585a4..0944b2c 100644
--- a/recipe_modules/submodule_roll/tests/full.expected/success.json
+++ b/recipe_modules/submodule_roll/tests/full.expected/success.json
@@ -55,6 +55,7 @@
],
"cwd": "[START_DIR]/checkout",
"name": "a1.git submodule update",
+ "timeout": 600,
"~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@"
]