Bug 1291473: accept pushdate from command line; r=garndt
☠☠ backed out by fc6ed18f76e1 ☠ ☠
authorDustin J. Mitchell <dustin@mozilla.com>
Wed, 13 Jul 2016 18:50:50 +0000
changeset 352100 fc1ed3fd8584161ae4693bd1c956e8254368b6bc
parent 352099 1fc133437bb01a39076f6633f0f888a52b5a2d61
child 352101 7d0cb37025ded808b8e53c874d29d772cd7c54a2
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgarndt
bugs1291473
milestone51.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 1291473: accept pushdate from command line; r=garndt MozReview-Commit-ID: BrGiowlMVCa
.taskcluster.yml
taskcluster/docs/parameters.rst
taskcluster/mach_commands.py
taskcluster/taskgraph/decision.py
taskcluster/taskgraph/task/legacy.py
--- a/.taskcluster.yml
+++ b/.taskcluster.yml
@@ -97,16 +97,17 @@ tasks:
           - '--'
           - bash
           - -cx
           - >
               cd /home/worker/checkouts/gecko &&
               ln -s /home/worker/artifacts artifacts &&
               ./mach --log-no-times taskgraph decision
               --pushlog-id='{{pushlog_id}}'
+              --pushdate='{{pushdate}}'
               --project='{{project}}'
               --message='{{comment}}'
               --owner='{{owner}}'
               --level='{{level}}'
               --base-repository='https://hg.mozilla.org/mozilla-central'
               --head-repository='{{{url}}}'
               --head-ref='{{revision}}'
               --head-rev='{{revision}}'
--- a/taskcluster/docs/parameters.rst
+++ b/taskcluster/docs/parameters.rst
@@ -40,16 +40,20 @@ Push Information
    value may be forged and *must not* be relied on for authentication.
 
 ``message``
    The commit message
 
 ``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.
+
 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
@@ -127,16 +127,20 @@ class MachCommands(MachCommandBase):
                      help='Treeherder revision hash (long revision id) to attach results to')
     @CommandArgument('--project',
                      required=True,
                      help='Project to use for creating task graph. Example: --project=try')
     @CommandArgument('--pushlog-id',
                      dest='pushlog_id',
                      required=True,
                      default=0)
+    @CommandArgument('--pushdate',
+                     dest='pushdate',
+                     required=True,
+                     default=0)
     @CommandArgument('--owner',
                      required=True,
                      help='email address of who owns this graph')
     @CommandArgument('--level',
                      required=True,
                      help='SCM level of this repository')
     def taskgraph_decision(self, **options):
         """Run the decision task: generate a task graph and submit to
--- a/taskcluster/taskgraph/decision.py
+++ b/taskcluster/taskgraph/decision.py
@@ -102,16 +102,17 @@ def get_decision_parameters(options):
     parameters = {n: options[n] for n in [
         'base_repository',
         'head_repository',
         'head_rev',
         'head_ref',
         'message',
         'project',
         'pushlog_id',
+        'pushdate',
         'owner',
         'level',
         'target_tasks_method',
     ] if n in options}
 
     project = parameters['project']
     try:
         parameters.update(PER_PROJECT_PARAMETERS[project])
--- a/taskcluster/taskgraph/task/legacy.py
+++ b/taskcluster/taskgraph/task/legacy.py
@@ -368,31 +368,29 @@ class LegacyTask(base.Task):
 
         jobs = templates.load(job_path, {})
 
         job_graph, trigger_tests = parse_commit(message, jobs)
 
         cmdline_interactive = params.get('interactive', False)
 
         # Default to current time if querying the head rev fails
-        push_epoch = int(time.time())
         vcs_info = query_vcs_info(params['head_repository'], params['head_rev'])
         changed_files = set()
         if vcs_info:
-            push_epoch = vcs_info.pushdate
 
             logger.debug(
                 '{} commits influencing task scheduling:'.format(len(vcs_info.changesets)))
             for c in vcs_info.changesets:
                 logger.debug("{cset} {desc}".format(
                     cset=c['node'][0:12],
                     desc=c['desc'].splitlines()[0].encode('ascii', 'ignore')))
                 changed_files |= set(c['files'])
 
-        pushdate = time.strftime('%Y%m%d%H%M%S', time.gmtime(push_epoch))
+        pushdate = time.strftime('%Y%m%d%H%M%S', time.gmtime(params['pushdate']))
 
         # Template parameters used when expanding the graph
         parameters = dict(gaia_info().items() + {
             'index': 'index',
             'project': project,
             'pushlog_id': params.get('pushlog_id', 0),
             'docker_image': docker_image,
             'base_repository': params['base_repository'] or
@@ -400,17 +398,17 @@ class LegacyTask(base.Task):
             'head_repository': params['head_repository'],
             'head_ref': params['head_ref'] or params['head_rev'],
             'head_rev': params['head_rev'],
             'pushdate': pushdate,
             'pushtime': pushdate[8:],
             'year': pushdate[0:4],
             'month': pushdate[4:6],
             'day': pushdate[6:8],
-            'rank': push_epoch,
+            'rank': params['pushdate'],
             'owner': params['owner'],
             'level': params['level'],
         }.items())
 
         routes_file = os.path.join(root, 'routes.json')
         with open(routes_file) as f:
             contents = json.load(f)
             json_routes = contents['routes']