Bug 1334624 - Set index routes for signing tasks based on build jobs. r=aki a=lizzard
authorJustin Wood <Callek@gmail.com>
Fri, 27 Jan 2017 14:24:31 -0500
changeset 378347 2e0af7243d08369ef93638aa306f6cc2056c28b9
parent 378346 c8eeb0d150df26360bb162db3da74ed686c8bca5
child 378348 436ada403de0388a12a65b6fd71ff96e4d31a10a
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaki, lizzard
bugs1334624
milestone53.0a2
Bug 1334624 - Set index routes for signing tasks based on build jobs. r=aki a=lizzard MozReview-Commit-ID: BhO0FTo3DKk
taskcluster/taskgraph/transforms/build_signing.py
taskcluster/taskgraph/transforms/signing.py
--- a/taskcluster/taskgraph/transforms/build_signing.py
+++ b/taskcluster/taskgraph/transforms/build_signing.py
@@ -8,16 +8,35 @@ Transform the signing task into an actua
 from __future__ import absolute_import, print_function, unicode_literals
 
 from taskgraph.transforms.base import TransformSequence
 
 transforms = TransformSequence()
 
 
 @transforms.add
+def add_signed_routes(config, jobs):
+    """Add routes corresponding to the routes of the build task
+       this corresponds to, with .signed inserted, for all gecko.v2 routes"""
+
+    for job in jobs:
+        dep_job = job['dependent-task']
+
+        job['routes'] = []
+        for dep_route in dep_job.task.get('routes', []):
+            if not dep_route.startswith('index.gecko.v2'):
+                continue
+            branch = dep_route.split(".")[3]
+            rest = ".".join(dep_route.split(".")[4:])
+            job['routes'].append(
+                'index.gecko.v2.{}.signed-nightly.{}'.format(branch, rest))
+        yield job
+
+
+@transforms.add
 def make_signing_description(config, jobs):
     for job in jobs:
         dep_job = job['dependent-task']
 
         if 'android' in dep_job.attributes.get('build_platform'):
             job_specs = [
                 {
                     'artifacts': ['public/build/target.apk',
--- a/taskcluster/taskgraph/transforms/signing.py
+++ b/taskcluster/taskgraph/transforms/signing.py
@@ -55,16 +55,19 @@ signing_description_schema = Schema({
     # unique label to describe this signing task, defaults to {dep.label}-signing
     Optional('label'): basestring,
 
     # treeherder is allowed here to override any defaults we use for signing.  See
     # taskcluster/taskgraph/transforms/task.py for the schema details, and the
     # below transforms for defaults of various values.
     Optional('treeherder'): task_description_schema['treeherder'],
 
+    # Routes specific to this task, if defined
+    Optional('routes'): [basestring],
+
     # If True, adds a route which funsize uses to schedule generation of partial mar
     # files for updates. Expected to be added on nightly builds only.
     Optional('use-funsize-route'): bool,
 })
 
 
 @transforms.add
 def validate(config, jobs):
@@ -115,15 +118,16 @@ def make_task_description(config, jobs):
             'worker': {'implementation': 'scriptworker-signing',
                        'upstream-artifacts': job['upstream-artifacts'],
                        'max-run-time': 3600},
             'scopes': ["project:releng:signing:cert:nightly-signing"] + signing_format_scopes,
             'dependencies': {job['depname']: dep_job.label},
             'attributes': attributes,
             'run-on-projects': dep_job.attributes.get('run_on_projects'),
             'treeherder': treeherder,
+            'routes': job.get('routes', []),
         }
 
         if job.get('use-funsize-route', False):
-            task['routes'] = ["index.project.releng.funsize.level-{level}.{project}".format(
-                project=config.params['project'], level=config.params['level'])]
+            task['routes'].append("index.project.releng.funsize.level-{level}.{project}".format(
+                project=config.params['project'], level=config.params['level']))
 
         yield task