Bug 1421002: Add an option to control where to find the try_task_config. r=dustin
authorTom Prince <mozilla@hocat.ca>
Tue, 21 Nov 2017 11:26:56 -0700
changeset 448267 d76f30fd68022233f6368bcab6fb03dad3b4744e
parent 448266 5c849056fcf23218de40bdb1732409d05b6e37d3
child 448268 e8f1edcdecbeb97f3ec4ef2d387d19da620c1a99
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1421002
milestone59.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 1421002: Add an option to control where to find the try_task_config. r=dustin MozReview-Commit-ID: ntC1fJOidr
taskcluster/mach_commands.py
taskcluster/taskgraph/decision.py
--- a/taskcluster/mach_commands.py
+++ b/taskcluster/mach_commands.py
@@ -147,16 +147,18 @@ class MachCommands(MachCommandBase):
     @CommandArgument('--owner',
                      required=True,
                      help='email address of who owns this graph')
     @CommandArgument('--level',
                      required=True,
                      help='SCM level of this repository')
     @CommandArgument('--target-tasks-method',
                      help='method for selecting the target tasks to generate')
+    @CommandArgument('--try-task-config-file',
+                     help='path to try task configuration file')
     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
@@ -198,23 +198,27 @@ def get_decision_parameters(options):
 
     # If the target method is nightly, we should build partials. This means
     # knowing what has been released previously.
     # An empty release_history is fine, it just means no partials will be built
     parameters.setdefault('release_history', dict())
     if 'nightly' in parameters.get('target_tasks_method', ''):
         parameters['release_history'] = populate_release_history('Firefox', project)
 
-    # if try_task_config.json is present, load it
-    task_config_file = os.path.join(os.getcwd(), 'try_task_config.json')
+    if options.get('try_task_config_file'):
+        task_config_file = os.path.abspath(options.get('try_task_config_file'))
+    else:
+        # if try_task_config.json is present, load it
+        task_config_file = os.path.join(os.getcwd(), 'try_task_config.json')
 
     # load try settings
     if 'try' in project:
         parameters['try_mode'] = None
         if os.path.isfile(task_config_file):
+            logger.info("using try tasks from {}".format(task_config_file))
             parameters['try_mode'] = 'try_task_config'
             with open(task_config_file, 'r') as fh:
                 parameters['try_task_config'] = json.load(fh)
         else:
             parameters['try_task_config'] = None
 
         if 'try:' in parameters['message']:
             parameters['try_mode'] = 'try_option_syntax'