Bug 1257619 - Add revision and revision_hash information to tasks r=dustin
MozReview-Commit-ID: KJEEO6oXDRh
This commit is contained in:
@@ -285,6 +285,7 @@ class Graph(object):
|
||||
from slugid import nice as slugid
|
||||
|
||||
import taskcluster_graph.transform.routes as routes_transform
|
||||
import taskcluster_graph.transform.treeherder as treeherder_transform
|
||||
from taskcluster_graph.commit_parser import parse_commit
|
||||
from taskcluster_graph.image_builder import (
|
||||
docker_image,
|
||||
@@ -454,6 +455,9 @@ class Graph(object):
|
||||
remove_caches_from_task(build_task)
|
||||
|
||||
if params['revision_hash']:
|
||||
treeherder_transform.add_treeherder_revision_info(build_task['task'],
|
||||
params['head_rev'],
|
||||
params['revision_hash'])
|
||||
routes_transform.decorate_task_treeherder_routes(build_task['task'],
|
||||
treeherder_route)
|
||||
routes_transform.decorate_task_json_routes(build_task['task'],
|
||||
@@ -526,6 +530,9 @@ class Graph(object):
|
||||
build_parameters,
|
||||
os.environ.get('TASK_ID', None))
|
||||
set_interactive_task(post_task, interactive)
|
||||
treeherder_transform.add_treeherder_revision_info(post_task['task'],
|
||||
params['head_rev'],
|
||||
params['revision_hash'])
|
||||
graph['tasks'].append(post_task)
|
||||
|
||||
for test in build['dependents']:
|
||||
@@ -572,6 +579,9 @@ class Graph(object):
|
||||
set_interactive_task(test_task, interactive)
|
||||
|
||||
if params['revision_hash']:
|
||||
treeherder_transform.add_treeherder_revision_info(test_task['task'],
|
||||
params['head_rev'],
|
||||
params['revision_hash'])
|
||||
routes_transform.decorate_task_treeherder_routes(
|
||||
test_task['task'],
|
||||
treeherder_route
|
||||
|
||||
@@ -5,6 +5,7 @@ import tarfile
|
||||
import urllib2
|
||||
|
||||
import taskcluster_graph.transform.routes as routes_transform
|
||||
import taskcluster_graph.transform.treeherder as treeherder_transform
|
||||
from slugid import nice as slugid
|
||||
from taskcluster_graph.templates import Templates
|
||||
|
||||
@@ -202,6 +203,11 @@ def normalize_image_details(graph, task, seen_images, params, decision_task_id):
|
||||
templates = Templates(TASKCLUSTER_ROOT)
|
||||
image_task = templates.load(IMAGE_BUILD_TASK, image_parameters)
|
||||
if params['revision_hash']:
|
||||
treeherder_transform.add_treeherder_revision_info(
|
||||
image_task['task'],
|
||||
params['head_rev'],
|
||||
params['revision_hash']
|
||||
)
|
||||
routes_transform.decorate_task_treeherder_routes(
|
||||
image_task['task'],
|
||||
"{}.{}".format(params['project'], params['revision_hash'])
|
||||
|
||||
@@ -39,4 +39,3 @@ def decorate_task_json_routes(task, json_routes, parameters):
|
||||
routes.append(route.format(**parameters))
|
||||
|
||||
task['routes'] = routes
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
def add_treeherder_revision_info(task, revision, revision_hash):
|
||||
# Only add treeherder information if task.extra.treeherder is present
|
||||
if 'extra' not in task and 'treeherder' not in task.extra:
|
||||
return
|
||||
|
||||
task['extra']['treeherder']['revision'] = revision
|
||||
task['extra']['treeherder']['revision_hash'] = revision_hash
|
||||
@@ -90,3 +90,5 @@ tasks:
|
||||
extra:
|
||||
treeherder:
|
||||
symbol: D
|
||||
revision: '{{revision}}'
|
||||
revision_hash: '{{revision_hash}}'
|
||||
|
||||
@@ -99,3 +99,5 @@ tasks:
|
||||
extra:
|
||||
treeherder:
|
||||
symbol: D
|
||||
revision: '{{revision}}'
|
||||
revision_hash: '{{revision_hash}}'
|
||||
|
||||
Reference in New Issue
Block a user