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 d5aae246f088
parent 516379 2cf0e44fb781
child 516381 1936822aea92
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
bugs1534283
milestone66.0
Bug 1534283 - add a 'tasks_for' property; r=tomprince, a=tomprince Differential Revision: https://phabricator.services.mozilla.com/D23569
.taskcluster.yml
taskcluster/docs/parameters.rst
taskcluster/mach_commands.py
taskcluster/taskgraph/decision.py
taskcluster/taskgraph/parameters.py
taskcluster/taskgraph/test/test_decision.py
--- 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
                   --pushlog-id='${push.pushlog_id}'
                   --pushdate='${push.pushdate}'
                   --project='${repository.project}'
                   --owner='${ownerEmail}'
                   --level='${repository.level}'
+                  --tasks-for='${tasks_for}'
                   --base-repository="$GECKO_BASE_REPOSITORY"
                   --head-repository="$GECKO_HEAD_REPOSITORY"
                   --head-ref="$GECKO_HEAD_REF"
                   --head-rev="$GECKO_HEAD_REV"
                   ${extraArgs}
 
           artifacts:
             'public':
--- 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
    ``head_repository``.
 
 ``owner``
    Email address indicating the person who made the push.  Note that this
    value may be forged and *must not* be relied on for authentication.
 
 ``message``
-   The commit message
+   The try syntax in the commit message, if any.
 
 ``pushlog_id``
    The ID from the ``hg.mozilla.org`` pushlog
 
 ``pushdate``
    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
 ``build_date``
    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.
 
 ``moz_build_date``
    A formatted timestamp of ``build_date``. Expressed as a string with the following
    format: %Y%m%d%H%M%S
 
+``tasks_for``
+   The ``tasks_for`` value used to generate the decision task.
+
 Tree Information
 ----------------
 
 ``project``
    Another name for what may otherwise be called tree or branch or
    repository.  This is the unqualified name, such as ``mozilla-central`` or
    ``cedar``.
 
--- a/taskcluster/mach_commands.py
+++ b/taskcluster/mach_commands.py
@@ -172,16 +172,18 @@ class MachCommands(MachCommandBase):
     @CommandArgument('--optimize-target-tasks',
                      type=strtobool,
                      nargs='?', const='true',
                      help='If specified, this indicates whether the target '
                           'tasks are eligible for optimization. Otherwise, '
                           'the default for the project is used.')
     @CommandArgument('--try-task-config-file',
                      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
         'head_rev',
         'head_ref',
         'project',
         'pushlog_id',
         'pushdate',
         'owner',
         'level',
         'target_tasks_method',
+        'tasks_for',
     ] if n in options}
 
     for n in (
         'comm_base_repository',
         'comm_head_repository',
         'comm_head_rev',
         'comm_head_ref',
     ):
--- 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_PARAMETERS = {
     '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,
         }
 
     @patch('taskgraph.decision.get_hg_revision_branch')
     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)