Bug 1258497: use `taskgraph decision` in decision task; r?gps draft
authorDustin J. Mitchell <dustin@mozilla.com>
Thu, 12 May 2016 15:52:25 +0000
changeset 367418 927ae951edbbfeec6fd371a62ff958eee581679f
parent 366368 427e0cb5e394a9e3b8047a0681675f350c92462d
child 367419 f1c435dedcc22700942f5dbbf457ce2654bc42a7
push id18238
push userdmitchell@mozilla.com
push dateMon, 16 May 2016 17:47:55 +0000
reviewersgps
bugs1258497
milestone49.0a1
Bug 1258497: use `taskgraph decision` in decision task; r?gps MozReview-Commit-ID: 9STbp4EPMrT
taskcluster/taskgraph/target_tasks.py
testing/taskcluster/tasks/decision/try.yml
--- a/taskcluster/taskgraph/target_tasks.py
+++ b/taskcluster/taskgraph/target_tasks.py
@@ -1,15 +1,16 @@
 # -*- coding: utf-8 -*-
 
 # 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
+from taskgraph import try_option_syntax
 
 _target_task_methods = {}
 def _target_task(name):
     def wrap(func):
         _target_task_methods[name] = func
         return func
     return wrap
 
@@ -23,18 +24,17 @@ def target_tasks_from_parameters(full_ta
     useful for re-running a decision task with the same target set as in an
     earlier run, by copying `target_tasks.json` into `parameters.yml`."""
     return parameters['target_tasks']
 
 @_target_task('try_option_syntax')
 def target_tasks_try_option_syntax(full_task_graph, parameters):
     """Generate a list of target tasks based on try syntax in
     parameters['message'] and, for context, the full task graph."""
-    from taskgraph.try_option_syntax import TryOptionSyntax
-    options = TryOptionSyntax(parameters['message'], full_task_graph)
+    options = try_option_syntax.TryOptionSyntax(parameters['message'], full_task_graph)
     return [t.label for t in full_task_graph.tasks.itervalues()
             if options.task_matches(t.attributes)]
 
 @_target_task('all_tasks')
 def target_tasks_all_tasks(full_task_graph, parameters):
     """Trivially target all tasks."""
     return full_task_graph.tasks.keys()
 
--- a/testing/taskcluster/tasks/decision/try.yml
+++ b/testing/taskcluster/tasks/decision/try.yml
@@ -19,31 +19,29 @@ tasks:
     task:
       created: '{{now}}'
       deadline: '{{#from_now}}1 day{{/from_now}}'
       metadata:
         owner: mozilla-taskcluster-maintenance@mozilla.com
         source: {{{source}}}
         name: "[tc] Initial decision task for try"
         description: |
-          This is the single most important task as it decides how all other tasks
-          get built.
+          Create the task-graph for a try push
 
       workerType: "gecko-decision"
       provisionerId: "aws-provisioner-v1"
 
       tags:
         createdForUser: {{owner}}
 
       scopes:
-        - "docker-worker:cache:level-{{level}}-{{project}}-tc-vcs-public-sources"
-        - "docker-worker:cache:level-{{level}}-{{project}}-gecko-decision"
-        - "queue:route:tc-treeherder-stage.{{project}}.{{revision_hash}}"
-        - "queue:route:tc-treeherder.{{project}}.{{revision_hash}}"
-        - "scheduler:extend-task-graph:*"
+        # Bug 1269443: cache scopes, etc. must be listed explicitly
+        - "docker-worker:cache:level-1-*"
+        - "docker-worker:cache:tooltool-cache"
+        - "assume:repo:hg.mozilla.org/try:*"
 
       routes:
         - "index.gecko.v2.{{project}}.latest.firefox.decision"
         - "tc-treeherder.{{project}}.{{revision_hash}}"
         - "tc-treeherder-stage.{{project}}.{{revision_hash}}"
 
       payload:
         env:
@@ -71,41 +69,36 @@ tasks:
 
         command:
           - /bin/bash
           - -cx
           - >
             mkdir -p /home/worker/artifacts &&
             checkout-gecko workspace &&
             cd workspace/gecko &&
-            ./mach taskcluster-graph
+            ln -s /home/worker/artifacts artifacts &&
+            ./mach taskgraph decision
+            --target-tasks-method=try_option_syntax
             --pushlog-id='{{pushlog_id}}'
             --project='{{project}}'
             --message='{{comment}}'
             --owner='{{owner}}'
             --level='{{level}}'
+            --base-repository='https://hg.mozilla.org/mozilla-central'
+            --head-repository='{{{url}}}'
+            --head-ref='{{revision}}'
+            --head-rev='{{revision}}'
             --revision-hash='{{revision_hash}}'
-            --extend-graph > /home/worker/artifacts/graph.json &&
-            ./mach taskcluster-graph
-            --pushlog-id='{{pushlog_id}}'
-            --project='{{project}}'
-            --message='try: -b do -p all -u all'
-            --owner='{{owner}}'
-            --revision-hash='{{revision_hash}}'
-            --extend-graph > /home/worker/artifacts/all_tasks.json
 
-        graphs:
-          - /home/worker/artifacts/graph.json
+        features:
+          taskclusterProxy: true
 
         artifacts:
           'public':
             type: 'directory'
             path: '/home/worker/artifacts'
-            # Arbitrary value for keeping these artifacts around.  They are just the
-            # graph.json and context directories for now, so nothing that needs
-            # to stay around for long.
             expires: '{{#from_now}}7 days{{/from_now}}'
 
       extra:
         treeherder:
           symbol: D
           revision: '{{revision}}'
           revision_hash: '{{revision_hash}}'