Bug 1286652: also remove cache scopes on try and fix scopes; r?Callek draft
authorDustin J. Mitchell <dustin@mozilla.com>
Wed, 13 Jul 2016 20:13:06 +0000
changeset 387320 69b4175ddb67d23b0fc5a8e7081a941782b88128
parent 387168 0ad1ec384324f0c7c2df6e3b76347f481d6e213e
child 525329 3fd88f0d74fc27a1cb2d788b7230c115c09953a5
push id22937
push userdmitchell@mozilla.com
push dateWed, 13 Jul 2016 20:20:50 +0000
reviewersCallek
bugs1286652
milestone50.0a1
Bug 1286652: also remove cache scopes on try and fix scopes; r?Callek MozReview-Commit-ID: 7s1CVCEVNwN
taskcluster/ci/legacy/tasks/builds/firefox_l10n_base.yml
taskcluster/ci/legacy/tasks/builds/mulet_haz_linux.yml
taskcluster/taskgraph/kind/legacy.py
--- 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