Bug 1394026 - Tag tasks with os and worker implementation. draft
authorBrian Stack <bstack@mozilla.com>
Fri, 25 Aug 2017 15:30:34 -0700
changeset 655338 d7ac15376a7fcf9ce7632ea8d1ae30512397af10
parent 655242 9957a25209908aaea4bfd4915c3201f006b29b6e
child 655339 0464262bcf3adf6589606695711ae6fab196900a
push id76840
push userbstack@mozilla.com
push dateTue, 29 Aug 2017 21:34:27 +0000
bugs1394026
milestone57.0a1
Bug 1394026 - Tag tasks with os and worker implementation. MozReview-Commit-ID: GWNiq6a3hlZ
taskcluster/taskgraph/transforms/job/__init__.py
taskcluster/taskgraph/transforms/task.py
--- a/taskcluster/taskgraph/transforms/job/__init__.py
+++ b/taskcluster/taskgraph/transforms/job/__init__.py
@@ -132,16 +132,20 @@ def make_task_description(config, jobs):
         if 'label' not in job:
             if 'name' not in job:
                 raise Exception("job has neither a name nor a label")
             job['label'] = '{}-{}'.format(config.kind, job['name'])
         if job.get('name'):
             del job['name']
 
         impl, os = worker_type_implementation(job['worker-type'])
+        if os:
+            job.setdefault('tags', {})['os'] = os
+        if impl:
+            job.setdefault('tags', {})['worker-implementation'] = impl
         worker = job.setdefault('worker', {})
         assert 'implementation' not in worker
         worker['implementation'] = impl
         if os:
             worker['os'] = os
 
         taskdesc = copy.deepcopy(job)
 
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -71,17 +71,17 @@ task_description_schema = Schema({
 
     # custom scopes for this task; any scopes required for the worker will be
     # added automatically. The following parameters will be substituted in each
     # scope:
     #  {level} -- the scm level of this push
     Optional('scopes'): [basestring],
 
     # Tags
-    Optional('tags'): {basestring: object},
+    Optional('tags'): {basestring: basestring},
 
     # custom "task.extra" content
     Optional('extra'): {basestring: object},
 
     # treeherder-related information; see
     # https://schemas.taskcluster.net/taskcluster-treeherder/v1/task-treeherder-config.json
     # If not specified, no treeherder extra information or routes will be
     # added to the task