Bug 1277595 - Add a --triggered-by=nightly flag to taskgraph, r=dustin
authoramiyaguchi@mozilla.com
Thu, 01 Sep 2016 09:20:51 -0700
changeset 312280 32a569f4df061afba57235815ee860dae64166d3
parent 312279 292a3b62983fd33329bca5a27534db2299dcbc4c
child 312281 c1aa2a15b4eb6c7b3bb66488541931412b159702
push id81316
push userjlund@mozilla.com
push dateThu, 01 Sep 2016 16:26:14 +0000
treeherdermozilla-inbound@dee2532bdc95 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1277595
milestone51.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 1277595 - Add a --triggered-by=nightly flag to taskgraph, r=dustin MozReview-Commit-ID: DztkFP8nCwc
taskcluster/mach_commands.py
taskcluster/taskgraph/decision.py
--- a/taskcluster/mach_commands.py
+++ b/taskcluster/mach_commands.py
@@ -139,16 +139,22 @@ class MachCommands(MachCommandBase):
                      type=int,
                      default=0)
     @CommandArgument('--owner',
                      required=True,
                      help='email address of who owns this graph')
     @CommandArgument('--level',
                      required=True,
                      help='SCM level of this repository')
+    @CommandArgument('--triggered-by',
+                     choices=['nightly', 'push'],
+                     default='push',
+                     help='Source of execution of the decision graph')
+    @CommandArgument('--target-tasks-method',
+                     help='method for selecting the target tasks to generate')
     def taskgraph_decision(self, **options):
         """Run the decision task: generate a task graph and submit to
         TaskCluster.  This is only meant to be called within decision tasks,
         and requires a great many arguments.  Commands like `mach taskgraph
         optimized` are better suited to use on the command line, and can take
         the parameters file generated by a decision task.  """
 
         import taskgraph.decision
--- a/taskcluster/taskgraph/decision.py
+++ b/taskcluster/taskgraph/decision.py
@@ -105,28 +105,33 @@ def get_decision_parameters(options):
         'head_rev',
         'head_ref',
         'message',
         'project',
         'pushlog_id',
         'pushdate',
         'owner',
         'level',
+        'triggered_by',
         'target_tasks_method',
     ] if n in options}
 
     project = parameters['project']
     try:
         parameters.update(PER_PROJECT_PARAMETERS[project])
     except KeyError:
         logger.warning("using default project parameters; add {} to "
                        "PER_PROJECT_PARAMETERS in {} to customize behavior "
                        "for this project".format(project, __file__))
         parameters.update(PER_PROJECT_PARAMETERS['default'])
 
+    # `target_tasks_method` has higher precedence than `project` parameters
+    if 'target_tasks_method' in options:
+        parameters['target_tasks_method'] = options['target_tasks_method']
+
     return Parameters(parameters)
 
 
 def write_artifact(filename, data):
     logger.info('writing artifact file `{}`'.format(filename))
     if not os.path.isdir(ARTIFACTS_DIR):
         os.mkdir(ARTIFACTS_DIR)
     path = os.path.join(ARTIFACTS_DIR, filename)