Bug 1293733: accept pushdate from command line; r=garndt

MozReview-Commit-ID: BrGiowlMVCa

--HG--
extra : rebase_source : e47b9e18b9dbc9e617f9bad165318a74c4e96e36
extra : source : fc1ed3fd8584161ae4693bd1c956e8254368b6bc
This commit is contained in:
Dustin J. Mitchell 2016-07-13 18:50:50 +00:00
parent 30ea94481e
commit f7a9bbac26
5 changed files with 13 additions and 4 deletions

View File

@ -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}}'

View File

@ -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
----------------

View File

@ -133,6 +133,11 @@ class MachCommands(MachCommandBase):
dest='pushlog_id',
required=True,
default=0)
@CommandArgument('--pushdate',
dest='pushdate',
required=True,
type=int,
default=0)
@CommandArgument('--owner',
required=True,
help='email address of who owns this graph')

View File

@ -107,6 +107,7 @@ def get_decision_parameters(options):
'message',
'project',
'pushlog_id',
'pushdate',
'owner',
'level',
'target_tasks_method',

View File

@ -373,11 +373,9 @@ class LegacyTask(base.Task):
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)))
@ -387,7 +385,7 @@ class LegacyTask(base.Task):
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() + {
@ -405,7 +403,7 @@ class LegacyTask(base.Task):
'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())