Bug 1201372: Remove workspace caches for try builds. r=garndt
authorWander Lairson Costa <wcosta@mozilla.com>
Fri, 11 Sep 2015 17:43:20 -0300
changeset 294570 078d2338db658618e6de7abe11b3209accba8c6e
parent 294569 338f610603fb3bbd5a6dd6eaa67ae321e40fdd54
child 294571 b704c24375e9ad3416ef34bd8e389857833d40da
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgarndt
bugs1201372
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1201372: Remove workspace caches for try builds. r=garndt Try build are supposed to always be clobbered, so we remove workspace caches for them.
testing/taskcluster/mach_commands.py
--- a/testing/taskcluster/mach_commands.py
+++ b/testing/taskcluster/mach_commands.py
@@ -184,16 +184,29 @@ def set_interactive_task(task, interacti
     if not interactive:
         return
 
     payload = task["task"]["payload"]
     if "features" not in payload:
         payload["features"] = {}
     payload["features"]["interactive"] = True
 
+def remove_caches_from_task(task):
+    r"""Remove all caches but tc-vcs from the task.
+
+    :param task: task definition.
+    """
+    try:
+        caches = task["task"]["payload"]["cache"]
+        for cache in caches.keys():
+            if cache != "tc-vcs":
+                caches.pop(cache)
+    except KeyError:
+        pass
+
 @CommandProvider
 class DecisionTask(object):
     @Command('taskcluster-decision', category="ci",
         description="Build a decision task")
     @CommandArgument('--project',
         required=True,
         help='Treeherder project name')
     @CommandArgument('--url',
@@ -360,16 +373,20 @@ class Graph(object):
 
         for build in job_graph:
             interactive = cmdline_interactive or build["interactive"]
             build_parameters = dict(parameters)
             build_parameters['build_slugid'] = slugid()
             build_task = templates.load(build['task'], build_parameters)
             set_interactive_task(build_task, interactive)
 
+            # try builds don't use cache
+            if project == "try":
+                remove_caches_from_task(build_task)
+
             if params['revision_hash']:
                 decorate_task_treeherder_routes(build_task['task'],
                                                 treeherder_route)
                 decorate_task_json_routes(build,
                                           build_task['task'],
                                           json_routes,
                                           build_parameters)