Bug 1282187 - bustage fix for task-reference not expanding right in task that publishes nightlies on update server via scriptworker -> balrogscript. r=bustage
authorJustin Wood <Callek@gmail.com>
Fri, 11 Nov 2016 07:17:22 -0500
changeset 439907 b5ec815f13d099e6a35dab57ba6eb49f51b8ec8a
parent 439906 5d8ba3560ae9a5f30f730be6e553b4d65654072d
child 439908 14136855228bb9bfddd434499f95f3466c603221
push id36120
push userCallek@gmail.com
push dateWed, 16 Nov 2016 18:58:20 +0000
reviewersbustage
bugs1282187
milestone52.0a1
Bug 1282187 - bustage fix for task-reference not expanding right in task that publishes nightlies on update server via scriptworker -> balrogscript. r=bustage MozReview-Commit-ID: I4EYtG9dMG0
taskcluster/taskgraph/transforms/balrog.py
taskcluster/taskgraph/transforms/task.py
--- a/taskcluster/taskgraph/transforms/balrog.py
+++ b/taskcluster/taskgraph/transforms/balrog.py
@@ -10,16 +10,18 @@ from __future__ import absolute_import, 
 from taskgraph.transforms.base import (
     validate_schema,
     TransformSequence
 )
 from taskgraph.transforms.task import task_description_schema
 from voluptuous import Schema, Any, Required, Optional
 
 
+ARTIFACT_URL = 'https://queue.taskcluster.net/v1/task/{}/artifacts/public'
+
 # Voluptuous uses marker objects as dictionary *keys*, but they are not
 # comparable, so we cast all of the keys back to regular strings
 task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
 
 transforms = TransformSequence()
 
 # shortcut for a string where task references are allowed
 taskref_or_string = Any(
@@ -69,25 +71,28 @@ def make_task_description(config, jobs):
             'treeherder', {}).get('machine', {}).get('platform', '')
         treeherder.setdefault('platform',
                               "{}/opt".format(dep_th_platform))
         treeherder.setdefault('tier', 2)
         treeherder.setdefault('kind', 'build')
 
         label = job.get('label', "balrog-{}".format(dep_job.label))
 
+        parent_task_artifacts_url = {
+            "task-reference": ARTIFACT_URL.format('<beetmover>')
+        }
+
         task = {
             'label': label,
             'description': "{} Balrog".format(
                 dep_job.task["metadata"]["description"]),
             # do we have to define worker type somewhere?
             'worker-type': 'scriptworker-prov-v1/balrogworker-v1',
             'worker': {'implementation': 'balrog',
-                       'taskid': {"task-reference":
-                                  '<beetmover>'}},
+                       'task_artifact_url': parent_task_artifacts_url},
             'scopes': [],
             'dependencies': {'beetmover': dep_job.label},
             'attributes': {
                 'nightly': dep_job.attributes.get('nightly', False),
                 'build_platform': dep_job.attributes.get('build_platform'),
                 'build_type': dep_job.attributes.get('build_type'),
             },
             'run-on-projects': dep_job.attributes.get('run_on_projects'),
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -18,18 +18,16 @@ from taskgraph.transforms.base import (
     validate_schema,
     TransformSequence
 )
 from voluptuous import Schema, Any, Required, Optional, Extra
 
 from .gecko_v2_whitelist import JOB_NAME_WHITELIST, JOB_NAME_WHITELIST_ERROR
 
 
-ARTIFACT_URL = 'https://queue.taskcluster.net/v1/task/{}/artifacts/{}'
-
 # shortcut for a string where task references are allowed
 taskref_or_string = Any(
     basestring,
     {Required('task-reference'): basestring})
 
 # A task description is a general description of a TaskCluster task
 task_description_schema = Schema({
     # the label for this task
@@ -310,17 +308,17 @@ task_description_schema = Schema({
         Required('taskid_of_manifest'): taskref_or_string,
 
         # beetmover template key
         Required('update_manifest'): bool,
     }, {
         Required('implementation'): 'balrog',
 
         # taskid of the signed beetmoved task
-        Required('taskid', default="invalid"): taskref_or_string,
+        Required('task_artifact_url'): taskref_or_string,
     }),
 
     # The "when" section contains descriptions of the circumstances
     # under which this task can be "optimized", that is, left out of the
     # task graph because it is unnecessary.
     Optional('when'): Any({
         # This task only needs to be run if a file matching one of the given
         # patterns has changed in the push.  The patterns use the mozpack
@@ -520,20 +518,18 @@ def build_beetmover_payload(config, task
         'update_manifest': worker['update_manifest']
     }
 
 
 @payload_builder('balrog')
 def build_balrog_payload(config, task, task_def):
     worker = task['worker']
 
-    artifact_url = ARTIFACT_URL.format(worker['taskid'], "public")
-
     task_def['payload'] = {
-        'parent_task_artifacts_url': artifact_url,
+        'parent_task_artifacts_url': worker['task_artifact_url'],
         # signing cert is unused, but required by balrogworker (Bug 1282187 c#7)
         'signing_cert': "dep",
     }
 
 
 @payload_builder('macosx-engine')
 def build_macosx_engine_payload(config, task, task_def):
     worker = task['worker']