Bug 1534283 - add a 'tasks_for' property; r=tomprince, a=tomprince
authorDustin J. Mitchell <dustin@mozilla.com>
Thu, 14 Mar 2019 20:01:32 +0000
changeset 516380 d5aae246f088e39286bb4360027f670c30e3ede4
parent 516379 2cf0e44fb781b00ae6b5fd0b2ff25766efdee981
child 516381 1936822aea92d858b08bfe7f54addcbb54493435
push id1973
push userdmitchell@mozilla.com
push dateFri, 15 Mar 2019 14:41:25 +0000
treeherdermozilla-release@980321059007 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstomprince, tomprince
Bug 1534283 - add a 'tasks_for' property; r=tomprince, a=tomprince Differential Revision: https://phabricator.services.mozilla.com/D23569
--- a/.taskcluster.yml
+++ b/.taskcluster.yml
@@ -233,16 +233,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
@@ -194,16 +194,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
@@ -58,16 +58,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)