Bug 1277595 - Add a --triggered-by=nightly flag to taskgraph, r?dustin
MozReview-Commit-ID: 7ivjAgatH96
--- 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 options.get('target_tasks_method'):
+ 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)