Bug 1418058: [taskcluster] Add the prefix for the graph parameters of the primary repo to the graph config; r=dustin

Differential Revision: https://phabricator.services.mozilla.com/D913

--HG--
extra : rebase_source : 20c7b2e7537ea55a8191b86388175c1a3ea7c42c
This commit is contained in:
Tom Prince 2018-04-11 11:08:48 -06:00
Родитель ec7000854d
Коммит fdb3fa18c8
4 изменённых файлов: 13 добавлений и 22 удалений

Просмотреть файл

@ -1,4 +1,5 @@
trust-domain: gecko
project-repo-param-prefix: ''
treeherder:
group-names:
'cram': 'Cram tests'

Просмотреть файл

@ -177,9 +177,11 @@ def register_callback_action(name, title, symbol, description, order=10000,
if not available(parameters):
return None
match = re.match(r'https://(hg.mozilla.org)/(.*?)/?$', parameters['head_repository'])
repo_param = '{}head_repository'.format(graph_config['project-repo-param-prefix'])
revision = parameters['{}head_rev'.format(graph_config['project-repo-param-prefix'])]
match = re.match(r'https://(hg.mozilla.org)/(.*?)/?$', parameters[repo_param])
if not match:
raise Exception('Unrecognized head_repository')
raise Exception('Unrecognized {}'.format(repo_param))
repo_scope = 'assume:repo:{}/{}:branch:default'.format(
match.group(1), match.group(2))
@ -198,14 +200,14 @@ def register_callback_action(name, title, symbol, description, order=10000,
'$let': {
'tasks_for': 'action',
'repository': {
'url': parameters['head_repository'],
'url': parameters[repo_param],
'project': parameters['project'],
'level': parameters['level'],
},
'push': {
'owner': 'mozilla-taskcluster-maintenance@mozilla.com',
'pushlog_id': parameters['pushlog_id'],
'revision': parameters['head_rev'],
'revision': revision,
},
'action': {
'name': name,

Просмотреть файл

@ -11,12 +11,16 @@ graph_config_schema = Schema({
# The trust-domain for this graph.
# (See https://firefox-source-docs.mozilla.org/taskcluster/taskcluster/taskgraph.html#taskgraph-trust-domain) # noqa
Required('trust-domain'): basestring,
# This specifes the prefix for repo parameters that refer to the project being built.
# This selects between `head_rev` and `comm_head_rev` and related paramters.
# (See http://firefox-source-docs.mozilla.org/taskcluster/taskcluster/parameters.html#push-information # noqa
# and http://firefox-source-docs.mozilla.org/taskcluster/taskcluster/parameters.html#comm-push-information) # noqa
Required('project-repo-param-prefix'): basestring,
Required('treeherder'): {
# Mapping of treeherder group symbols to descriptive names
Required('group-names'): {basestring: basestring}
},
Required('index'): {
Required('products'): [basestring],
},
Required('try'): {

Просмотреть файл

@ -614,25 +614,9 @@ V2_L10N_TEMPLATES = [
# the roots of the treeherder routes
TREEHERDER_ROUTE_ROOT = 'tc-treeherder'
# Which repository repository revision to use when reporting results to treeherder.
DEFAULT_BRANCH_REV_PARAM = 'head_rev'
BRANCH_REV_PARAM = {
'comm-esr45': 'comm_head_rev',
'comm-esr52': 'comm_head_rev',
'comm-beta': 'comm_head_rev',
'comm-central': 'comm_head_rev',
'comm-aurora': 'comm_head_rev',
'try-comm-central': 'comm_head_rev',
}
def get_branch_rev(config):
return config.params[
BRANCH_REV_PARAM.get(
config.params['project'],
DEFAULT_BRANCH_REV_PARAM
)
]
return config.params['{}head_rev'.format(config.graph_config['project-repo-param-prefix'])]
COALESCE_KEY = '{project}.{job-identifier}'