Bug 1534283 - add a 'tasks_for' property; r=tomprince
authorDustin J. Mitchell <dustin@mozilla.com>
Thu, 14 Mar 2019 20:01:32 +0000
changeset 464094 eb2a987c6ba2d2476f6c312085a9e9dda228d507
parent 464093 c2b6d184e16a581939dd7120a2b6d87192e930c7
child 464095 e44be7f40c6daf7a5858aee63626805527427f41
push id80554
push userdmitchell@mozilla.com
push dateThu, 14 Mar 2019 21:57:43 +0000
treeherderautoland@6e05f81a2f8f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 1534283 - add a 'tasks_for' property; r=tomprince Differential Revision: https://phabricator.services.mozilla.com/D23569
--- a/.taskcluster.yml
+++ b/.taskcluster.yml
@@ -236,16 +236,17 @@ tasks:
                   cd /builds/worker/checkouts/gecko &&
                   ln -s /builds/worker/artifacts artifacts &&
                   ./mach --log-no-times taskgraph decision
+                  --tasks-for='${tasks_for}'
--- a/taskcluster/docs/parameters.rst
+++ b/taskcluster/docs/parameters.rst
@@ -40,17 +40,17 @@ Push Information
    the symbolic ref containing ``head_rev`` that should be pulled from
    Email address indicating the person who made the push.  Note that this
    value may be forged and *must not* be relied on for authentication.
-   The commit message
+   The try syntax in the commit message, if any.
    The ID from the ``hg.mozilla.org`` pushlog
    The timestamp of the push to the repository that triggered this decision
    task.  Expressed as an integer seconds since the UNIX epoch.
@@ -60,16 +60,19 @@ Push Information
    The timestamp of the build date. Defaults to ``pushdate`` and falls back to present time of
    taskgraph invocation. Expressed as an integer seconds since the UNIX epoch.
    A formatted timestamp of ``build_date``. Expressed as a string with the following
    format: %Y%m%d%H%M%S
+   The ``tasks_for`` value used to generate the decision task.
 Tree Information
    Another name for what may otherwise be called tree or branch or
    repository.  This is the unqualified name, such as ``mozilla-central`` or
--- a/taskcluster/mach_commands.py
+++ b/taskcluster/mach_commands.py
@@ -172,16 +172,18 @@ class MachCommands(MachCommandBase):
                      nargs='?', const='true',
                      help='If specified, this indicates whether the target '
                           'tasks are eligible for optimization. Otherwise, '
                           'the default for the project is used.')
                      help='path to try task configuration file')
+    @CommandArgument('--tasks-for',
+                     help='the tasks_for value used to generate this task')
     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
@@ -205,16 +205,17 @@ def get_decision_parameters(config, opti
+        'tasks_for',
     ] if n in options}
     for n in (
--- a/taskcluster/taskgraph/parameters.py
+++ b/taskcluster/taskgraph/parameters.py
@@ -76,16 +76,17 @@ PARAMETERS = {
     'release_partners': None,
     'release_partner_config': None,
     'release_partner_build_number': 1,
     'release_type': 'nightly',
     'release_product': None,
     'required_signoffs': [],
     'signoff_urls': {},
     'target_tasks_method': 'default',
+    'tasks_for': 'hg-push',
     'try_mode': None,
     'try_options': None,
     'try_task_config': None,
     'version': get_version(),
     'comm_base_repository': 'https://hg.mozilla.org/comm-central',
--- a/taskcluster/taskgraph/test/test_decision.py
+++ b/taskcluster/taskgraph/test/test_decision.py
@@ -57,16 +57,17 @@ class TestGetDecisionParameters(unittest
             'head_repository': 'https://hg.mozilla.org/mozilla-central',
             'head_rev': 'abcd',
             'head_ref': 'ef01',
             'message': '',
             'project': 'mozilla-central',
             'pushlog_id': 143,
             'pushdate': 1503691511,
             'owner': 'nobody@mozilla.com',
+            'tasks_for': 'hg-push',
             'level': 3,
     def test_simple_options(self, mock_get_hg_revision_branch):
         mock_get_hg_revision_branch.return_value = 'default'
         with MockedOpen({self.ttc_file: None}):
             params = decision.get_decision_parameters(FAKE_GRAPH_CONFIG, self.options)