commit bde7267e4b02879693a0018661ff6e7673186731
parent 1cb805ff3339b686c0741b39cd05c22cf14eaa5f
Author: Andrew Halberstadt <ahal@mozilla.com>
Date: Fri, 31 Oct 2025 13:32:03 +0000
Bug 1996667 - Don't require sparse/shallow cache when there isn't even a checkout cache, r=taskgraph-reviewers,bhearsum
This started getting triggered because as opposed to Hg sparse
checkouts, shallow Git clones get enabled by default. This caused a
failure in some Android tasks that had `use-caches` set to False.
Differential Revision: https://phabricator.services.mozilla.com/D270347
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/taskcluster/gecko_taskgraph/transforms/task.py b/taskcluster/gecko_taskgraph/transforms/task.py
@@ -2557,6 +2557,7 @@ def check_run_task_caches(config, tasks):
re.VERBOSE,
)
+ re_checkout_cache = re.compile("^checkouts")
re_sparse_checkout_cache = re.compile("^checkouts-sparse")
re_shallow_checkout_cache = re.compile("^checkouts-git-shallow")
@@ -2576,6 +2577,7 @@ def check_run_task_caches(config, tasks):
require_sparse_cache = False
require_shallow_cache = False
+ have_checkout_cache = False
have_sparse_cache = False
have_shallow_cache = False
@@ -2619,6 +2621,9 @@ def check_run_task_caches(config, tasks):
cache = cache[len(cache_prefix) :]
+ if re_checkout_cache.match(cache):
+ have_checkout_cache = True
+
if re_sparse_checkout_cache.match(cache):
have_sparse_cache = True
@@ -2643,14 +2648,14 @@ def check_run_task_caches(config, tasks):
"naming requirements" % (task["label"], cache)
)
- if require_sparse_cache and not have_sparse_cache:
+ if have_checkout_cache and require_sparse_cache and not have_sparse_cache:
raise Exception(
"%s is using a sparse checkout but not using "
"a sparse checkout cache; change the checkout "
"cache name so it is sparse aware" % task["label"]
)
- if require_shallow_cache and not have_shallow_cache:
+ if have_checkout_cache and require_shallow_cache and not have_shallow_cache:
raise Exception(
"%s is using a shallow clone but not using "
"a shallow checkout cache; change the checkout "