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 387319 fdb579b14aa01e2e75cb33700050ff0d0132a4ca
parent 387168 0ad1ec384324f0c7c2df6e3b76347f481d6e213e
child 525328 f233d4cb3680d2719de67c482f6ed883ea4121b2
push id22936
push userdmitchell@mozilla.com
push dateWed, 13 Jul 2016 20:19:38 +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
@@ -1,15 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from __future__ import absolute_import, print_function, unicode_literals
 
-import copy
 import json
 import logging
 import os
 import re
 import time
 from collections import namedtuple
 
 from . import base
@@ -151,19 +150,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