Bug 1341352 - add balrogworker support for releases. r=aki a=release DONTBUILD"
authorMihai Tabara <mtabara@mozilla.com>
Tue, 04 Apr 2017 07:37:24 +0800
changeset 555409 5a8eea2b095eb12eb482a31e019b11d0925bcee8
parent 555408 de7a6af789d8b0f32fa51a9877989ccc1418b557
child 555410 6553dcb0df0cdae8cc9d68ae47fa04ca28aaf8c2
push id52236
push usercykesiopka.bmo@gmail.com
push dateTue, 04 Apr 2017 09:12:57 +0000
reviewersaki, release
bugs1341352
milestone55.0a1
Bug 1341352 - add balrogworker support for releases. r=aki a=release DONTBUILD" MozReview-Commit-ID: KbkKMdKmQpG
taskcluster/taskgraph/transforms/balrog.py
taskcluster/taskgraph/util/scriptworker.py
--- a/taskcluster/taskgraph/transforms/balrog.py
+++ b/taskcluster/taskgraph/transforms/balrog.py
@@ -4,17 +4,18 @@
 """
 Transform the beetmover task into an actual 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.scriptworker import get_balrog_server_scope
+from taskgraph.util.scriptworker import (get_balrog_server_scope,
+                                         get_balrog_channel_scopes)
 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
 # 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()}
 
@@ -87,26 +88,28 @@ def make_task_description(config, jobs):
             "taskId": {"task-reference": "<beetmover>"},
             "taskType": "beetmover",
             "paths": [
                 "public/manifest.json"
             ],
         }]
 
         server_scope = get_balrog_server_scope(config)
+        channel_scopes = get_balrog_channel_scopes(config)
+
         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',
                 'upstream-artifacts': upstream_artifacts,
             },
-            'scopes': [server_scope],
+            'scopes': [server_scope] + channel_scopes,
             'dependencies': {'beetmover': dep_job.label},
             'attributes': attributes,
             'run-on-projects': dep_job.attributes.get('run_on_projects'),
             'treeherder': treeherder,
         }
 
         yield task
--- a/taskcluster/taskgraph/util/scriptworker.py
+++ b/taskcluster/taskgraph/util/scriptworker.py
@@ -126,26 +126,70 @@ BALROG_SCOPE_ALIAS_TO_PROJECT = [[
 ], [
     'beta', set([
         'mozilla-beta',
     ])
 ], [
     'release', set([
         'mozilla-release',
     ])
+], [
+    'esr', set([
+        'mozilla-esr52',
+    ])
 ]]
 
 """Map the balrog scope aliases to the actual scopes.
 """
 BALROG_SERVER_SCOPES = {
-    'nightly': 'project:releng:balrog:nightly',
-    'aurora': 'project:releng:balrog:nightly',
-    'beta': 'project:releng:balrog:nightly',
-    'release': 'project:releng:balrog:nightly',
-    'default': 'project:releng:balrog:nightly',
+    'nightly': 'project:releng:balrog:server:nightly',
+    'aurora': 'project:releng:balrog:server:aurora',
+    'beta': 'project:releng:balrog:server:beta',
+    'release': 'project:releng:balrog:server:release',
+    'esr': 'project:releng:balrog:server:esr',
+    'default': 'project:releng:balrog:server:dep',
+}
+
+"""Map the balrog scope aliases to the actual channel scopes.
+"""
+BALROG_CHANNEL_SCOPES = {
+    'nightly': [
+        'project:releng:balrog:channel:nightly'
+    ],
+    'aurora': [
+        'project:releng:balrog:channel:aurora'
+    ],
+    'beta': [
+        'project:releng:balrog:channel:beta',
+        'project:releng:balrog:channel:beta-localtest',
+        'project:releng:balrog:channel:beta-cdntest'
+    ],
+    'release': [
+        'project:releng:balrog:channel:release',
+        'project:releng:balrog:channel:release-localtest',
+        'project:releng:balrog:channel:release-cdntest'
+    ],
+    'esr': [
+        'project:releng:balrog:channel:esr',
+        'project:releng:balrog:channel:esr-localtest',
+        'project:releng:balrog:channel:esr-cdntest'
+    ],
+    'default': [
+        'project:releng:balrog:channel:nightly'
+        'project:releng:balrog:channel:aurora'
+        'project:releng:balrog:channel:beta',
+        'project:releng:balrog:channel:beta-localtest',
+        'project:releng:balrog:channel:beta-cdntest'
+        'project:releng:balrog:channel:release',
+        'project:releng:balrog:channel:release-localtest',
+        'project:releng:balrog:channel:release-cdntest'
+        'project:releng:balrog:channel:esr',
+        'project:releng:balrog:channel:esr-localtest',
+        'project:releng:balrog:channel:esr-cdntest'
+    ]
 }
 
 
 # scope functions {{{1
 def get_scope_from_project(alias_to_project_map, alias_to_scope_map, config):
     """Determine the restricted scope from `config.params['project']`.
 
     Args:
@@ -231,16 +275,22 @@ get_beetmover_action_scope = functools.p
 )
 
 get_balrog_server_scope = functools.partial(
     get_scope_from_project,
     BALROG_SCOPE_ALIAS_TO_PROJECT,
     BALROG_SERVER_SCOPES
 )
 
+get_balrog_channel_scopes = functools.partial(
+    get_scope_from_project,
+    BALROG_SCOPE_ALIAS_TO_PROJECT,
+    BALROG_CHANNEL_SCOPES
+)
+
 
 # release_config {{{1
 def get_release_config(config):
     """Get the build number and version for a release task.
 
     Currently only applies to beetmover tasks.
 
     Args: