Skip to content

Commit 16a45d5

Browse files
committed
Backed out changeset 36b1cce63e74 (bug 1314795) for lint failures a=backout CLOSED TREE
1 parent 5cba5b5 commit 16a45d5

File tree

10 files changed

+28
-39
lines changed

10 files changed

+28
-39
lines changed

taskcluster/docs/parameters.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ Push Information
4949
The timestamp of the push to the repository that triggered this decision
5050
task. Expressed as an integer seconds since the UNIX epoch.
5151

52-
``build_date``
53-
The timestamp of the build date. Defaults to ``pushdate`` and falls back to present time of
54-
taskgraph invocation. Expressed as an integer seconds since the UNIX epoch.
55-
56-
``moz_build_date``
57-
A formatted timestamp of ``build_date``. Expressed as a string with the following
58-
format: %Y%m%d%H%M%S
59-
6052
Tree Information
6153
----------------
6254

taskcluster/taskgraph/decision.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import os
1010
import json
1111
import logging
12-
13-
import time
1412
import yaml
1513

1614
from .generator import TaskGraphGenerator
@@ -127,12 +125,6 @@ def get_decision_parameters(options):
127125
if '@' not in parameters['owner']:
128126
parameters['owner'] += '@noreply.mozilla.org'
129127

130-
# use the pushdate as build_date if given, else use current time
131-
parameters['build_date'] = parameters['pushdate'] or int(time.time())
132-
# moz_build_date is the build identifier based on build_date
133-
parameters['moz_build_date'] = time.strftime("%Y%m%d%H%M%S",
134-
time.gmtime(parameters['build_date']))
135-
136128
project = parameters['project']
137129
try:
138130
parameters.update(PER_PROJECT_PARAMETERS[project])

taskcluster/taskgraph/task/docker_image.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ def __eq__(self, other):
3838

3939
@classmethod
4040
def load_tasks(cls, kind, path, config, params, loaded_tasks):
41+
pushdate = time.strftime('%Y%m%d%H%M%S', time.gmtime(params['pushdate']))
42+
4143
parameters = {
4244
'pushlog_id': params.get('pushlog_id', 0),
43-
'pushdate': params['moz_build_date'],
44-
'pushtime': params['moz_build_date'][8:],
45-
'year': params['moz_build_date'][0:4],
46-
'month': params['moz_build_date'][4:6],
47-
'day': params['moz_build_date'][6:8],
45+
'pushdate': pushdate,
46+
'pushtime': pushdate[8:],
47+
'year': pushdate[0:4],
48+
'month': pushdate[4:6],
49+
'day': pushdate[6:8],
4850
'project': params['project'],
4951
'docker_image': docker_image,
5052
'base_repository': params['base_repository'] or params['head_repository'],

taskcluster/taskgraph/transforms/android_stuff.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def setup_task(config, tasks):
2323
'GECKO_HEAD_REF': config.params['head_rev'],
2424
'GECKO_HEAD_REPOSITORY': config.params['head_repository'],
2525
'GECKO_HEAD_REV': config.params['head_rev'],
26-
'MOZ_BUILD_DATE': config.params['moz_build_date'],
26+
'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S",
27+
time.gmtime(config.params['pushdate'])),
2728
'MOZ_SCM_LEVEL': config.params['level'],
2829
'MH_BRANCH': config.params['project'],
2930
})

taskcluster/taskgraph/transforms/job/hazard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def docker_worker_hazard(config, job, taskdesc):
5454

5555
env = worker['env']
5656
env.update({
57-
'MOZ_BUILD_DATE': config.params['moz_build_date'],
57+
'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S", time.gmtime(config.params['pushdate'])),
5858
'MOZ_SCM_LEVEL': config.params['level'],
5959
})
6060

taskcluster/taskgraph/transforms/job/mozharness.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def mozharness_on_docker_worker_setup(config, job, taskdesc):
100100
'MOZHARNESS_SCRIPT': run['script'],
101101
'MH_BRANCH': config.params['project'],
102102
'MH_BUILD_POOL': 'taskcluster',
103-
'MOZ_BUILD_DATE': config.params['moz_build_date'],
103+
'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S", time.gmtime(config.params['pushdate'])),
104104
'MOZ_SCM_LEVEL': config.params['level'],
105105
})
106106

@@ -197,7 +197,7 @@ def mozharness_on_windows(config, job, taskdesc):
197197

198198
env = worker['env']
199199
env.update({
200-
'MOZ_BUILD_DATE': config.params['moz_build_date'],
200+
'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S", time.gmtime(config.params['pushdate'])),
201201
'MOZ_SCM_LEVEL': config.params['level'],
202202
'TOOLTOOL_REPO': 'https://github.com/mozilla/build-tooltool',
203203
'TOOLTOOL_REV': 'master',

taskcluster/taskgraph/transforms/job/spidermonkey.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def docker_worker_spidermonkey(config, job, taskdesc, schema=sm_run_schema):
5252
env.update({
5353
'MOZHARNESS_DISABLE': 'true',
5454
'SPIDERMONKEY_VARIANT': run['spidermonkey-variant'],
55-
'MOZ_BUILD_DATE': config.params['moz_build_date'],
55+
'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S", time.gmtime(config.params['pushdate'])),
5656
'MOZ_SCM_LEVEL': config.params['level'],
5757
})
5858

taskcluster/taskgraph/transforms/job/toolchain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def docker_worker_toolchain(config, job, taskdesc):
4343

4444
env = worker['env']
4545
env.update({
46-
'MOZ_BUILD_DATE': config.params['moz_build_date'],
46+
'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S", time.gmtime(config.params['pushdate'])),
4747
'MOZ_SCM_LEVEL': config.params['level'],
4848
'TOOLS_DISABLE': 'true',
4949
})
@@ -92,7 +92,7 @@ def windows_toolchain(config, job, taskdesc):
9292

9393
env = worker['env']
9494
env.update({
95-
'MOZ_BUILD_DATE': config.params['moz_build_date'],
95+
'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S", time.gmtime(config.params['pushdate'])),
9696
'MOZ_SCM_LEVEL': config.params['level'],
9797
'TOOLTOOL_REPO': 'https://github.com/mozilla/build-tooltool',
9898
'TOOLTOOL_REV': 'master',

taskcluster/taskgraph/transforms/marionette_harness.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def setup_task(config, tasks):
2424
'GECKO_HEAD_REF': config.params['head_rev'],
2525
'GECKO_HEAD_REPOSITORY': config.params['head_repository'],
2626
'GECKO_HEAD_REV': config.params['head_rev'],
27-
'MOZ_BUILD_DATE': config.params['moz_build_date'],
27+
'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S",
28+
time.gmtime(config.params['pushdate'])),
2829
'MOZ_SCM_LEVEL': config.params['level'],
2930
})
3031

taskcluster/taskgraph/transforms/task.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
# indexed task iff it has a higher rank. If unspecified,
110110
# 'by-tier' behavior will be used.
111111
'rank': Any(
112-
# Rank is equal the timestamp of the build_date for tier-1
112+
# Rank is equal the timestamp of the pushdate for tier-1
113113
# tasks, and zero for non-tier-1. This sorts tier-{2,3}
114114
# builds below tier-1 in the index.
115115
'by-tier',
@@ -118,10 +118,10 @@
118118
# sure a task is last in the index).
119119
int,
120120

121-
# Rank is equal to the timestamp of the build_date. This
121+
# Rank is equal to the timestamp of the pushdate. This
122122
# option can be used to override the 'by-tier' behavior
123123
# for non-tier-1 tasks.
124-
'build_date',
124+
'pushdate',
125125
),
126126
},
127127

@@ -293,7 +293,7 @@
293293

294294
V2_ROUTE_TEMPLATES = [
295295
"index.gecko.v2.{project}.latest.{product}.{job-name-gecko-v2}",
296-
"index.gecko.v2.{project}.pushdate.{build_date_long}.{product}.{job-name-gecko-v2}",
296+
"index.gecko.v2.{project}.pushdate.{pushdate_long}.{product}.{job-name-gecko-v2}",
297297
"index.gecko.v2.{project}.revision.{head_rev}.{product}.{job-name-gecko-v2}",
298298
]
299299

@@ -466,8 +466,9 @@ def add_index_routes(config, tasks):
466466
subs = config.params.copy()
467467
for n in job_name:
468468
subs['job-name-' + n] = job_name[n]
469-
subs['build_date_long'] = time.strftime("%Y.%m.%d.%Y%m%d%H%M%S",
470-
time.gmtime(config.params['build_date']))
469+
subs['pushdate_long'] = time.strftime(
470+
"%Y.%m.%d.%Y%m%d%H%M%S",
471+
time.gmtime(config.params['pushdate']))
471472
subs['product'] = index['product']
472473

473474
if 'buildbot' in job_name:
@@ -485,9 +486,9 @@ def add_index_routes(config, tasks):
485486
# rank is zero for non-tier-1 tasks and based on pushid for others;
486487
# this sorts tier-{2,3} builds below tier-1 in the index
487488
tier = task.get('treeherder', {}).get('tier', 3)
488-
extra_index['rank'] = 0 if tier > 1 else int(config.params['build_date'])
489-
elif rank == 'build_date':
490-
extra_index['rank'] = int(config.params['build_date'])
489+
extra_index['rank'] = 0 if tier > 1 else int(config.params['pushdate'])
490+
elif rank == 'pushdate':
491+
extra_index['rank'] = int(config.params['pushdate'])
491492
else:
492493
extra_index['rank'] = rank
493494

@@ -597,7 +598,7 @@ def check_v2_routes():
597598
('{index}', 'index'),
598599
('{build_product}', '{product}'),
599600
('{build_name}-{build_type}', '{job-name-gecko-v2}'),
600-
('{year}.{month}.{day}.{pushdate}', '{build_date_long}')]:
601+
('{year}.{month}.{day}.{pushdate}', '{pushdate_long}')]:
601602
routes = [r.replace(mh, tg) for r in routes]
602603

603604
if sorted(routes) != sorted(V2_ROUTE_TEMPLATES):

0 commit comments

Comments
 (0)