Bug 1318200 - Pass topsrcdir into decision parameters; r?dustin draft
authorGregory Szorc <gps@mozilla.com>
Thu, 17 Nov 2016 17:42:55 -0800
changeset 441328 06242e612265680a1dbc28f47b126146b1be87cc
parent 441327 4e499341a65666cf20149c0dd0d95f1766f6a59f
child 441329 5d0047a01623a8cc5aff209e30d4c5302c31d9af
push id36394
push userbmo:gps@mozilla.com
push dateFri, 18 Nov 2016 18:38:31 +0000
Bug 1318200 - Pass topsrcdir into decision parameters; r?dustin This will allow filters and other code with access to parameters to examine the source checkout. Previously, we passed in "root" via options. But it was only exposed to the TaskGraphGenerator instance and not available in parameters. MozReview-Commit-ID: G2YKmlT0syB
--- a/taskcluster/docs/parameters.rst
+++ b/taskcluster/docs/parameters.rst
@@ -64,16 +64,19 @@ Push Information
    A formatted timestamp of ``build_date``. Expressed as a string with the following
    format: %Y%m%d%H%M%S
 Tree Information
+   Path to source checkout. (Should be set automatically.)
    Another name for what may otherwise be called tree or branch or
    repository.  This is the unqualified name, such as ``mozilla-central`` or
    The `SCM level
--- a/taskcluster/mach_commands.py
+++ b/taskcluster/mach_commands.py
@@ -155,16 +155,17 @@ class MachCommands(MachCommandBase):
         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
+            options['topsrcdir'] = self.topsrcdir
             return taskgraph.decision.taskgraph_decision(options)
         except Exception:
     @SubCommand('taskgraph', 'action-task',
                 description="Run the action task")
     @CommandArgument('--root', '-r',
--- a/taskcluster/taskgraph/decision.py
+++ b/taskcluster/taskgraph/decision.py
@@ -114,16 +114,17 @@ def get_decision_parameters(options):
+        'topsrcdir',
     ] if n in options}
     # Define default filter list, as most configurations shouldn't need
     # custom filters.
     parameters['filters'] = [
--- a/taskcluster/taskgraph/parameters.py
+++ b/taskcluster/taskgraph/parameters.py
@@ -22,16 +22,17 @@ PARAMETER_NAMES = set([
+    'topsrcdir',
 class Parameters(ReadOnlyDict):
     """An immutable dictionary with nicer KeyError messages on failure"""
     def check(self):
         names = set(self)