Backed out changeset fc1ed3fd8584 (bug 1291473) on suspicion of breaking decision tasks
authorGregory Szorc <gps@mozilla.com>
Mon, 08 Aug 2016 13:15:37 -0700
changeset 308600 fc6ed18f76e16d3e2a392c93fd77b867e12955e4
parent 308599 fe048eedd71ab4551131d03ddfb13e1f3d876dd0
child 308601 98ad8d33b747018425edb486f8345a7c4c1d47cc
push idunknown
push userunknown
push dateunknown
bugs1291473
milestone51.0a1
backs outfc1ed3fd8584161ae4693bd1c956e8254368b6bc
Backed out changeset fc1ed3fd8584 (bug 1291473) on suspicion of breaking decision tasks
.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,17 +97,16 @@ 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,20 +40,16 @@ 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,20 +127,16 @@ 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,17 +102,16 @@ 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,29 +368,31 @@ 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(params['pushdate']))
+        pushdate = time.strftime('%Y%m%d%H%M%S', time.gmtime(push_epoch))
 
         # 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
@@ -398,17 +400,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': params['pushdate'],
+            'rank': push_epoch,
             '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']