Bug 1289643 - Allow level-{{level}}-checkouts cache to be used on Try; r?dustin
Previously, the VCS checkout cache would be optimized away on Try. This
meant every task on Try had to create its own checkout from scratch. This
meant writing ~150,000 files. By allowing use of the cache, we minimize
the amount of work tasks need to perform on Try and therefore make tasks
complete faster, on average.
MozReview-Commit-ID: EWuic8lFVtv
--- a/taskcluster/taskgraph/task/legacy.py
+++ b/taskcluster/taskgraph/task/legacy.py
@@ -147,16 +147,20 @@ def set_interactive_task(task, interacti
def remove_caches_from_task(task):
r"""Remove all caches but vcs from the task.
:param task: task definition.
"""
whitelist = [
re.compile("^level-[123]-.*-tc-vcs(-public-sources)?$"),
re.compile("^level-[123]-hg-shared$"),
+ # The assumption here is that `hg robustcheckout --purge` is used and
+ # the checkout will start from a clean slate on job execution. This
+ # means there should be no contamination from previous tasks.
+ re.compile("^level-[123]-checkouts$"),
re.compile("^tooltool-cache$"),
]
try:
caches = task["task"]["payload"]["cache"]
scopes = task["task"]["scopes"]
for cache in caches.keys():
if not any(pat.match(cache) for pat in whitelist):
caches.pop(cache)