Bug 1325479 - Fix repo scopes in action task r=dustin

MozReview-Commit-ID: AGfoFtjR5LI

--HG--
extra : rebase_source : 5903b03e4f3ad12e92b2c98761c2f0ea04cabd4d
This commit is contained in:
Brian Stack 2016-12-22 17:08:33 -05:00
Родитель f7262dd0c3
Коммит 434009fae3
2 изменённых файлов: 10 добавлений и 2 удалений

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

@ -19,7 +19,7 @@ scopes:
# Bug 1269443: cache scopes, etc. must be listed explicitly
- "docker-worker:cache:tooltool-cache"
- "secrets:get:project/taskcluster/gecko/hgfingerprint"
- "assume:repo:hg.mozilla.org/{{project}}:*"
- {{repo_scope}}
routes:
- "tc-treeherder.v2.{{project}}.{{head_rev}}.{{pushlog_id}}"

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

@ -8,6 +8,7 @@ from __future__ import absolute_import, print_function, unicode_literals
import os
import json
import logging
import re
import time
import yaml
@ -178,10 +179,17 @@ def write_artifact(filename, data):
def get_action_yml(parameters):
templates = Templates(os.path.join(GECKO, "taskcluster/taskgraph"))
action_parameters = parameters.copy()
match = re.match(r'https://(hg.mozilla.org)/(.*?)/?$', action_parameters['head_repository'])
if not match:
raise Exception('Unrecognized head_repository')
repo_scope = 'assume:repo:{}/{}:*'.format(
match.group(1), match.group(2))
action_parameters.update({
"action": "{{action}}",
"action_args": "{{action_args}}",
"project": parameters["project"],
"repo_scope": repo_scope,
"from_now": json_time_from_now,
"now": current_json_time()
})