Bug 1286652: also remove cache scopes on try and fix scopes; r?Callek
MozReview-Commit-ID: 7s1CVCEVNwN
--- a/taskcluster/ci/legacy/tasks/builds/firefox_l10n_base.yml
+++ b/taskcluster/ci/legacy/tasks/builds/firefox_l10n_base.yml
@@ -5,17 +5,17 @@
build_name: 'linux64-l10n'
build_product: 'firefox'
build_type: 'opt'
docker-image: desktop-build
task:
scopes:
- 'docker-worker:cache:tooltool-cache'
- 'docker-worker:relengapi-proxy:tooltool.download.public'
- - 'docker-worker:cache:level-{{level}}-{{project}}-{{build_name}}-workspace'
+ - 'docker-worker:cache:level-{{level}}-{{project}}-l10n-{{build_name}}-workspace'
payload:
image:
type: 'task-image'
path: 'public/image.tar'
taskId:
task-reference: "<docker-image>"
cache:
--- a/taskcluster/ci/legacy/tasks/builds/mulet_haz_linux.yml
+++ b/taskcluster/ci/legacy/tasks/builds/mulet_haz_linux.yml
@@ -10,17 +10,17 @@ task:
workerType: mulet-debug
routes:
- 'index.buildbot.branches.{{project}}.linux64-haz-mulet'
- 'index.buildbot.revisions.{{head_rev}}.{{project}}.linux64-haz-mulet'
scopes:
- - 'docker-worker:cache:level-{{level}}-{{project}}-build-mulet-linux-workspace'
+ - 'docker-worker:cache:level-{{level}}-{{project}}-build-mulet-haz-linux-workspace'
- 'docker-worker:cache:tooltool-cache'
- 'docker-worker:relengapi-proxy:tooltool.download.public'
payload:
cache:
level-{{level}}-{{project}}-build-mulet-haz-linux-workspace: '/home/worker/workspace'
tooltool-cache: '/home/worker/tools/tooltool-cache'
--- a/taskcluster/taskgraph/kind/legacy.py
+++ b/taskcluster/taskgraph/kind/legacy.py
@@ -151,19 +151,25 @@ def remove_caches_from_task(task):
:param task: task definition.
"""
whitelist = [
re.compile("^level-[123]-.*-tc-vcs(-public-sources)?$"),
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)
+ scope = 'docker-worker:cache:' + cache
+ try:
+ scopes.remove(scope)
+ except ValueError:
+ raise ValueError("scope '{}' not in {}".format(scope, scopes))
except KeyError:
pass
def query_vcs_info(repository, revision):
"""Query the pushdate and pushid of a repository/revision.
This is intended to be used on hg.mozilla.org/mozilla-central and