Skip to content

Commit

Permalink
Bug 1291473: accept pushdate from command line; r=garndt
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: BrGiowlMVCa

--HG--
extra : rebase_source : cf257129fcb1f6214949407b6a3956fd9698aa5b
  • Loading branch information
djmitche committed Jul 13, 2016
1 parent 4d9c990 commit 05e1597
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ tasks:
ln -s /home/worker/artifacts artifacts &&
./mach --log-no-times taskgraph decision
--pushlog-id='{{pushlog_id}}'
--pushdate='{{pushdate}}'
--project='{{project}}'
--message='{{comment}}'
--owner='{{owner}}'
Expand Down
4 changes: 4 additions & 0 deletions taskcluster/docs/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ Push Information
``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
----------------

Expand Down
4 changes: 4 additions & 0 deletions taskcluster/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ def taskgraph_optimized(self, **options):
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')
Expand Down
1 change: 1 addition & 0 deletions taskcluster/taskgraph/decision.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def get_decision_parameters(options):
'message',
'project',
'pushlog_id',
'pushdate',
'owner',
'level',
'target_tasks_method',
Expand Down
6 changes: 2 additions & 4 deletions taskcluster/taskgraph/task/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,9 @@ def load_tasks(cls, kind, path, config, params, loaded_tasks):
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)))
Expand All @@ -387,7 +385,7 @@ def load_tasks(cls, kind, path, config, params, loaded_tasks):
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() + {
Expand All @@ -405,7 +403,7 @@ def load_tasks(cls, kind, path, config, params, loaded_tasks):
'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())
Expand Down

0 comments on commit 05e1597

Please sign in to comment.