Bug 1383066 - Set schedulerId on all actions tasks r=dustin
authorBrian Stack <bstack@mozilla.com>
Thu, 27 Jul 2017 17:25:02 -0700
changeset 420558 755215a3b81f07056d8df1873209413c2b8fa394
parent 420557 159e20b9dd04c941f3e48f6c90586bebb94c7a08
child 420559 bd0071cbb121acba0ae2bc3db0cf4596c8995ee9
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1383066
milestone56.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 1383066 - Set schedulerId on all actions tasks r=dustin MozReview-Commit-ID: CJr9nCfrSqQ
taskcluster/taskgraph/actions/add-new-jobs.py
taskcluster/taskgraph/actions/backfill.py
taskcluster/taskgraph/actions/run_missing_tests.py
taskcluster/taskgraph/actions/util.py
--- a/taskcluster/taskgraph/actions/add-new-jobs.py
+++ b/taskcluster/taskgraph/actions/add-new-jobs.py
@@ -47,13 +47,12 @@ def add_new_jobs_action(parameters, inpu
             task = full_task_graph.tasks[elem]
 
             # fix up the task's dependencies, similar to how optimization would
             # have done in the decision
             dependencies = {name: label_to_taskid[label]
                             for name, label in task.dependencies.iteritems()}
             task_def = resolve_task_references(task.label, task.task, dependencies)
             task_def.setdefault('dependencies', []).extend(dependencies.itervalues())
-            task_def['schedulerId'] = 'gecko-level-{}'.format(parameters['level'])
             # actually create the new task
-            create_task(slugid(), task_def)
+            create_task(slugid(), task_def, parameters['level'])
         else:
             raise Exception('{} was not found in the task-graph'.format(elem))
--- a/taskcluster/taskgraph/actions/backfill.py
+++ b/taskcluster/taskgraph/actions/backfill.py
@@ -81,12 +81,11 @@ def backfill_action(parameters, input, t
                 'public/label-to-taskid.json')
 
         if label in full_task_graph.tasks.keys():
             task = full_task_graph.tasks[label]
             dependencies = {name: label_to_taskid[label]
                             for name, label in task.dependencies.iteritems()}
             task_def = resolve_task_references(task.label, task.task, dependencies)
             task_def.setdefault('dependencies', []).extend(dependencies.itervalues())
-            task_def['schedulerId'] = 'gecko-level-{}'.format(parameters['level'])
-            create_task(slugid(), task_def)
+            create_task(slugid(), task_def, parameters['level'])
         else:
             logging.info('Could not find {} on {}. Skipping.'.format(label, push))
--- a/taskcluster/taskgraph/actions/run_missing_tests.py
+++ b/taskcluster/taskgraph/actions/run_missing_tests.py
@@ -56,12 +56,12 @@ def run_missing_tests(parameters, input,
     for task in to_run:
 
         # fix up the task's dependencies, similar to how optimization would
         # have done in the decision
         dependencies = {name: label_to_taskid[label]
                         for name, label in task.dependencies.iteritems()}
         task_def = resolve_task_references(task.label, task.task, dependencies)
         task_def.setdefault('dependencies', []).extend(dependencies.itervalues())
-        create_task(slugid(), task_def)
+        create_task(slugid(), task_def, parameters['level'])
 
     logger.info('Out of {} test tasks, {} already existed and the action created {}'.format(
         already_run + len(to_run), already_run, len(to_run)))
--- a/taskcluster/taskgraph/actions/util.py
+++ b/taskcluster/taskgraph/actions/util.py
@@ -19,20 +19,21 @@ testing = False
 def find_decision_task(parameters):
     """Given the parameters for this action, find the taskId of the decision
     task"""
     return find_task_id('gecko.v2.{}.pushlog-id.{}.decision'.format(
         parameters['project'],
         parameters['pushlog_id']))
 
 
-def create_task(task_id, task_def):
+def create_task(task_id, task_def, level):
     """Create a new task.  The task definition will have {relative-datestamp':
     '..'} rendered just like in a decision task.  Action callbacks should use
     this function to create new tasks, as it has the additional advantage of
     allowing easy debugging with `mach taskgraph action-callback --test`."""
+    task_def['schedulerId'] = 'gecko-level-{}'.format(level)
     if testing:
         json.dump([task_id, task_def], sys.stdout,
                   sort_keys=True, indent=4, separators=(',', ': '))
         return
     label = task_def['metadata']['name']
     session = get_session()
     create.create_task(session, task_id, label, task_def)