bug 1415391 - fix beetmover-cdns worker-type schema. r=dustin
authorAki Sasaki <asasaki@mozilla.com>
Wed, 08 Nov 2017 10:12:34 -0800
changeset 444600 136574f7a5e4a793a8306f020c9d4b15655e0d53
parent 444599 a6108f6cc6a1859b2d9dfb705baefc044ea4871a
child 444601 0fd32f2a273f58413d3c1a9d53125208e9d1d201
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1415391 - fix beetmover-cdns worker-type schema. r=dustin I think I copied this from source_test.py, but didn't need it. This patch switches to `optionally_keyed_by` and `resolve_keyed_by`. This also fixes a bug where our next mozilla-beta Fennec beta would have used the dev beetmover pool instead of the production pool. MozReview-Commit-ID: IdLNmFzieMi
--- a/taskcluster/taskgraph/transforms/beetmover_cdns.py
+++ b/taskcluster/taskgraph/transforms/beetmover_cdns.py
@@ -3,17 +3,19 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 Transform the beetmover-cdns task into a task description.
 from __future__ import absolute_import, print_function, unicode_literals
 from taskgraph.transforms.base import TransformSequence
-from taskgraph.util.schema import validate_schema, Schema
+from taskgraph.util.schema import (
+    optionally_keyed_by, resolve_keyed_by, validate_schema, Schema
 from taskgraph.util.scriptworker import (
     get_beetmover_bucket_scope, get_beetmover_action_scope
 from taskgraph.transforms.job import job_description_schema
 from taskgraph.transforms.task import task_description_schema
 from voluptuous import Any, Required, Optional
 # Voluptuous uses marker objects as dictionary *keys*, but they are not
@@ -30,20 +32,17 @@ taskref_or_string = Any(
 beetmover_cdns_description_schema = Schema({
     Required('name'): basestring,
     Required('product'): basestring,
     Required('treeherder-platform'): basestring,
     Optional('attributes'): {basestring: object},
     Optional('job-from'): task_description_schema['job-from'],
     Optional('run'): {basestring: object},
     Optional('run-on-projects'): task_description_schema['run-on-projects'],
-    Required('worker-type'): Any(
-        job_description_schema['worker-type'],
-        {'by-project': {basestring: job_description_schema['worker-type']}},
-    ),
+    Required('worker-type'): optionally_keyed_by('project', basestring),
     Optional('dependencies'): {basestring: taskref_or_string},
     Optional('index'): {basestring: basestring},
     Optional('routes'): [basestring],
 def validate(config, jobs):
@@ -65,23 +64,28 @@ def make_beetmover_cdns_description(conf
         label = job['name']
         description = (
             "Beetmover push to cdns for '{product}'".format(
+        resolve_keyed_by(
+            job, 'worker-type', item_name=job['name'],
+            project=config.params['project']
+        )
         bucket_scope = get_beetmover_bucket_scope(config)
         action_scope = get_beetmover_action_scope(config)
         task = {
             'label': label,
             'description': description,
-            'worker-type': 'scriptworker-prov-v1/beetmoverworker-dev',
+            'worker-type': job['worker-type'],
             'scopes': [bucket_scope, action_scope],
             'product': job['product'],
             'dependencies': job['dependencies'],
             'attributes': job.get('attributes', {}),
             'run-on-projects': job.get('run-on-projects'),
             'treeherder': treeherder,