Bug 1277595 - Add a --triggered-by=nightly flag to taskgraph, r=dustin

MozReview-Commit-ID: DztkFP8nCwc

--HG--
extra : rebase_source : 35bf7740541674614459574e44e70cbd258fa7a1
This commit is contained in:
amiyaguchi@mozilla.com 2016-09-01 09:20:51 -07:00
parent d9f7626454
commit c503809166
2 changed files with 11 additions and 0 deletions

View File

@ -144,6 +144,12 @@ class MachCommands(MachCommandBase):
@CommandArgument('--level', @CommandArgument('--level',
required=True, required=True,
help='SCM level of this repository') 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): def taskgraph_decision(self, **options):
"""Run the decision task: generate a task graph and submit to """Run the decision task: generate a task graph and submit to
TaskCluster. This is only meant to be called within decision tasks, TaskCluster. This is only meant to be called within decision tasks,

View File

@ -110,6 +110,7 @@ def get_decision_parameters(options):
'pushdate', 'pushdate',
'owner', 'owner',
'level', 'level',
'triggered_by',
'target_tasks_method', 'target_tasks_method',
] if n in options} ] if n in options}
@ -122,6 +123,10 @@ def get_decision_parameters(options):
"for this project".format(project, __file__)) "for this project".format(project, __file__))
parameters.update(PER_PROJECT_PARAMETERS['default']) 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) return Parameters(parameters)