зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 36b1cce63e74 (bug 1314795) for lint failures a=backout CLOSED TREE
This commit is contained in:
Родитель
5cba5b5a25
Коммит
16a45d598b
|
@ -49,14 +49,6 @@ Push Information
|
|||
The timestamp of the push to the repository that triggered this decision
|
||||
task. Expressed as an integer seconds since the UNIX epoch.
|
||||
|
||||
``build_date``
|
||||
The timestamp of the build date. Defaults to ``pushdate`` and falls back to present time of
|
||||
taskgraph invocation. Expressed as an integer seconds since the UNIX epoch.
|
||||
|
||||
``moz_build_date``
|
||||
A formatted timestamp of ``build_date``. Expressed as a string with the following
|
||||
format: %Y%m%d%H%M%S
|
||||
|
||||
Tree Information
|
||||
----------------
|
||||
|
||||
|
|
|
@ -9,8 +9,6 @@ from __future__ import absolute_import, print_function, unicode_literals
|
|||
import os
|
||||
import json
|
||||
import logging
|
||||
|
||||
import time
|
||||
import yaml
|
||||
|
||||
from .generator import TaskGraphGenerator
|
||||
|
@ -127,12 +125,6 @@ def get_decision_parameters(options):
|
|||
if '@' not in parameters['owner']:
|
||||
parameters['owner'] += '@noreply.mozilla.org'
|
||||
|
||||
# use the pushdate as build_date if given, else use current time
|
||||
parameters['build_date'] = parameters['pushdate'] or int(time.time())
|
||||
# moz_build_date is the build identifier based on build_date
|
||||
parameters['moz_build_date'] = time.strftime("%Y%m%d%H%M%S",
|
||||
time.gmtime(parameters['build_date']))
|
||||
|
||||
project = parameters['project']
|
||||
try:
|
||||
parameters.update(PER_PROJECT_PARAMETERS[project])
|
||||
|
|
|
@ -38,13 +38,15 @@ class DockerImageTask(base.Task):
|
|||
|
||||
@classmethod
|
||||
def load_tasks(cls, kind, path, config, params, loaded_tasks):
|
||||
pushdate = time.strftime('%Y%m%d%H%M%S', time.gmtime(params['pushdate']))
|
||||
|
||||
parameters = {
|
||||
'pushlog_id': params.get('pushlog_id', 0),
|
||||
'pushdate': params['moz_build_date'],
|
||||
'pushtime': params['moz_build_date'][8:],
|
||||
'year': params['moz_build_date'][0:4],
|
||||
'month': params['moz_build_date'][4:6],
|
||||
'day': params['moz_build_date'][6:8],
|
||||
'pushdate': pushdate,
|
||||
'pushtime': pushdate[8:],
|
||||
'year': pushdate[0:4],
|
||||
'month': pushdate[4:6],
|
||||
'day': pushdate[6:8],
|
||||
'project': params['project'],
|
||||
'docker_image': docker_image,
|
||||
'base_repository': params['base_repository'] or params['head_repository'],
|
||||
|
|
|
@ -23,7 +23,8 @@ def setup_task(config, tasks):
|
|||
'GECKO_HEAD_REF': config.params['head_rev'],
|
||||
'GECKO_HEAD_REPOSITORY': config.params['head_repository'],
|
||||
'GECKO_HEAD_REV': config.params['head_rev'],
|
||||
'MOZ_BUILD_DATE': config.params['moz_build_date'],
|
||||
'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S",
|
||||
time.gmtime(config.params['pushdate'])),
|
||||
'MOZ_SCM_LEVEL': config.params['level'],
|
||||
'MH_BRANCH': config.params['project'],
|
||||
})
|
||||
|
|
|
@ -54,7 +54,7 @@ def docker_worker_hazard(config, job, taskdesc):
|
|||
|
||||
env = worker['env']
|
||||
env.update({
|
||||
'MOZ_BUILD_DATE': config.params['moz_build_date'],
|
||||
'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S", time.gmtime(config.params['pushdate'])),
|
||||
'MOZ_SCM_LEVEL': config.params['level'],
|
||||
})
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ def mozharness_on_docker_worker_setup(config, job, taskdesc):
|
|||
'MOZHARNESS_SCRIPT': run['script'],
|
||||
'MH_BRANCH': config.params['project'],
|
||||
'MH_BUILD_POOL': 'taskcluster',
|
||||
'MOZ_BUILD_DATE': config.params['moz_build_date'],
|
||||
'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S", time.gmtime(config.params['pushdate'])),
|
||||
'MOZ_SCM_LEVEL': config.params['level'],
|
||||
})
|
||||
|
||||
|
@ -197,7 +197,7 @@ def mozharness_on_windows(config, job, taskdesc):
|
|||
|
||||
env = worker['env']
|
||||
env.update({
|
||||
'MOZ_BUILD_DATE': config.params['moz_build_date'],
|
||||
'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S", time.gmtime(config.params['pushdate'])),
|
||||
'MOZ_SCM_LEVEL': config.params['level'],
|
||||
'TOOLTOOL_REPO': 'https://github.com/mozilla/build-tooltool',
|
||||
'TOOLTOOL_REV': 'master',
|
||||
|
|
|
@ -52,7 +52,7 @@ def docker_worker_spidermonkey(config, job, taskdesc, schema=sm_run_schema):
|
|||
env.update({
|
||||
'MOZHARNESS_DISABLE': 'true',
|
||||
'SPIDERMONKEY_VARIANT': run['spidermonkey-variant'],
|
||||
'MOZ_BUILD_DATE': config.params['moz_build_date'],
|
||||
'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S", time.gmtime(config.params['pushdate'])),
|
||||
'MOZ_SCM_LEVEL': config.params['level'],
|
||||
})
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ def docker_worker_toolchain(config, job, taskdesc):
|
|||
|
||||
env = worker['env']
|
||||
env.update({
|
||||
'MOZ_BUILD_DATE': config.params['moz_build_date'],
|
||||
'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S", time.gmtime(config.params['pushdate'])),
|
||||
'MOZ_SCM_LEVEL': config.params['level'],
|
||||
'TOOLS_DISABLE': 'true',
|
||||
})
|
||||
|
@ -92,7 +92,7 @@ def windows_toolchain(config, job, taskdesc):
|
|||
|
||||
env = worker['env']
|
||||
env.update({
|
||||
'MOZ_BUILD_DATE': config.params['moz_build_date'],
|
||||
'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S", time.gmtime(config.params['pushdate'])),
|
||||
'MOZ_SCM_LEVEL': config.params['level'],
|
||||
'TOOLTOOL_REPO': 'https://github.com/mozilla/build-tooltool',
|
||||
'TOOLTOOL_REV': 'master',
|
||||
|
|
|
@ -24,7 +24,8 @@ def setup_task(config, tasks):
|
|||
'GECKO_HEAD_REF': config.params['head_rev'],
|
||||
'GECKO_HEAD_REPOSITORY': config.params['head_repository'],
|
||||
'GECKO_HEAD_REV': config.params['head_rev'],
|
||||
'MOZ_BUILD_DATE': config.params['moz_build_date'],
|
||||
'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S",
|
||||
time.gmtime(config.params['pushdate'])),
|
||||
'MOZ_SCM_LEVEL': config.params['level'],
|
||||
})
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ task_description_schema = Schema({
|
|||
# indexed task iff it has a higher rank. If unspecified,
|
||||
# 'by-tier' behavior will be used.
|
||||
'rank': Any(
|
||||
# Rank is equal the timestamp of the build_date for tier-1
|
||||
# Rank is equal the timestamp of the pushdate for tier-1
|
||||
# tasks, and zero for non-tier-1. This sorts tier-{2,3}
|
||||
# builds below tier-1 in the index.
|
||||
'by-tier',
|
||||
|
@ -118,10 +118,10 @@ task_description_schema = Schema({
|
|||
# sure a task is last in the index).
|
||||
int,
|
||||
|
||||
# Rank is equal to the timestamp of the build_date. This
|
||||
# Rank is equal to the timestamp of the pushdate. This
|
||||
# option can be used to override the 'by-tier' behavior
|
||||
# for non-tier-1 tasks.
|
||||
'build_date',
|
||||
'pushdate',
|
||||
),
|
||||
},
|
||||
|
||||
|
@ -293,7 +293,7 @@ BUILDBOT_ROUTE_TEMPLATES = [
|
|||
|
||||
V2_ROUTE_TEMPLATES = [
|
||||
"index.gecko.v2.{project}.latest.{product}.{job-name-gecko-v2}",
|
||||
"index.gecko.v2.{project}.pushdate.{build_date_long}.{product}.{job-name-gecko-v2}",
|
||||
"index.gecko.v2.{project}.pushdate.{pushdate_long}.{product}.{job-name-gecko-v2}",
|
||||
"index.gecko.v2.{project}.revision.{head_rev}.{product}.{job-name-gecko-v2}",
|
||||
]
|
||||
|
||||
|
@ -466,8 +466,9 @@ def add_index_routes(config, tasks):
|
|||
subs = config.params.copy()
|
||||
for n in job_name:
|
||||
subs['job-name-' + n] = job_name[n]
|
||||
subs['build_date_long'] = time.strftime("%Y.%m.%d.%Y%m%d%H%M%S",
|
||||
time.gmtime(config.params['build_date']))
|
||||
subs['pushdate_long'] = time.strftime(
|
||||
"%Y.%m.%d.%Y%m%d%H%M%S",
|
||||
time.gmtime(config.params['pushdate']))
|
||||
subs['product'] = index['product']
|
||||
|
||||
if 'buildbot' in job_name:
|
||||
|
@ -485,9 +486,9 @@ def add_index_routes(config, tasks):
|
|||
# rank is zero for non-tier-1 tasks and based on pushid for others;
|
||||
# this sorts tier-{2,3} builds below tier-1 in the index
|
||||
tier = task.get('treeherder', {}).get('tier', 3)
|
||||
extra_index['rank'] = 0 if tier > 1 else int(config.params['build_date'])
|
||||
elif rank == 'build_date':
|
||||
extra_index['rank'] = int(config.params['build_date'])
|
||||
extra_index['rank'] = 0 if tier > 1 else int(config.params['pushdate'])
|
||||
elif rank == 'pushdate':
|
||||
extra_index['rank'] = int(config.params['pushdate'])
|
||||
else:
|
||||
extra_index['rank'] = rank
|
||||
|
||||
|
@ -597,7 +598,7 @@ def check_v2_routes():
|
|||
('{index}', 'index'),
|
||||
('{build_product}', '{product}'),
|
||||
('{build_name}-{build_type}', '{job-name-gecko-v2}'),
|
||||
('{year}.{month}.{day}.{pushdate}', '{build_date_long}')]:
|
||||
('{year}.{month}.{day}.{pushdate}', '{pushdate_long}')]:
|
||||
routes = [r.replace(mh, tg) for r in routes]
|
||||
|
||||
if sorted(routes) != sorted(V2_ROUTE_TEMPLATES):
|
||||
|
|
Загрузка…
Ссылка в новой задаче