Bug 1352367 - [push-apk] deactivate dry-run option on aurora and beta r=aki a=release
authorJohan Lorenzo <jlorenzo@mozilla.com>
Thu, 06 Apr 2017 11:04:53 +0200
changeset 379452 acc4c147ae006e22c51820caf6386054d6e05a31
parent 379451 5ec9b3104a4cc38b1d28e6f49f0c0dc61642314e
child 379453 88fce9c3223f281b9ab7f13f82eba44aabed9d4b
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, release
bugs1352367
milestone53.0
Bug 1352367 - [push-apk] deactivate dry-run option on aurora and beta r=aki a=release
taskcluster/ci/push-apk/kind.yml
taskcluster/taskgraph/transforms/push_apk.py
taskcluster/taskgraph/util/scriptworker.py
--- a/taskcluster/ci/push-apk/kind.yml
+++ b/taskcluster/ci/push-apk/kind.yml
@@ -18,18 +18,17 @@ jobs:
         attributes:
             build_platform: android-nightly
             nightly: true
         worker-type: scriptworker-prov-v1/pushapk-v1
         worker:
             upstream-artifacts: # see transforms
             google-play-track: # see transforms
             implementation: push-apk
-            # TODO unhardcode that line
-            dry-run: true
+            dry-run: # see transforms
         scopes: # see transforms
         treeherder:
             symbol: pub(gp)
             platform: Android/opt
             tier: 2
             kind: other
         run-on-projects:
             - mozilla-aurora
--- a/taskcluster/taskgraph/transforms/push_apk.py
+++ b/taskcluster/taskgraph/transforms/push_apk.py
@@ -5,17 +5,18 @@
 Transform the push-apk kind into an actual task description.
 """
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 import functools
 
 from taskgraph.transforms.base import TransformSequence
-from taskgraph.util.scriptworker import get_push_apk_scope, get_push_apk_track
+from taskgraph.util.scriptworker import get_push_apk_scope, get_push_apk_track, \
+    get_push_apk_dry_run_option
 from taskgraph.util.push_apk import fill_labels_tranform, validate_jobs_schema_transform_partial, \
     validate_dependent_tasks_transform, delete_non_required_fields_transform, generate_dependencies
 from voluptuous import Schema, Required
 
 
 transforms = TransformSequence()
 
 push_apk_description_schema = Schema({
@@ -45,16 +46,17 @@ transforms.add(validate_dependent_tasks_
 
 
 @transforms.add
 def make_task_description(config, jobs):
     for job in jobs:
         job['dependencies'] = generate_dependencies(job['dependent-tasks'])
         job['worker']['upstream-artifacts'] = generate_upstream_artifacts(job['dependencies'])
         job['worker']['google-play-track'] = get_push_apk_track(config)
+        job['worker']['dry-run'] = get_push_apk_dry_run_option(config)
         job['scopes'] = [get_push_apk_scope(config)]
 
         yield job
 
 
 transforms.add(delete_non_required_fields_transform)
 
 
--- a/taskcluster/taskgraph/util/scriptworker.py
+++ b/taskcluster/taskgraph/util/scriptworker.py
@@ -220,16 +220,23 @@ PUSH_APK_GOOGLE_PLAY_TRACT = {
 
 PUSH_APK_BREAKPOINT_WORKER_TYPE = {
     'aurora': 'aws-provisioner-v1/taskcluster-generic',
     'beta': 'null-provisioner/human-breakpoint',
     'release': 'null-provisioner/human-breakpoint',
     'default': 'invalid/invalid',
 }
 
+PUSH_APK_DRY_RUN_OPTION = {
+    'aurora': False,
+    'beta': False,
+    'release': True,
+    'default': True,
+}
+
 
 # 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:
         alias_to_project_map (list of lists): each list pair contains the
             alias and the set of projects that match.  This is ordered.
@@ -337,16 +344,22 @@ get_push_apk_track = functools.partial(
 )
 
 get_push_apk_breakpoint_worker_type = functools.partial(
     get_scope_from_project,
     PUSH_APK_SCOPE_ALIAS_TO_PROJECT,
     PUSH_APK_BREAKPOINT_WORKER_TYPE
 )
 
+get_push_apk_dry_run_option = functools.partial(
+    get_scope_from_project,
+    PUSH_APK_SCOPE_ALIAS_TO_PROJECT,
+    PUSH_APK_DRY_RUN_OPTION
+)
+
 
 # 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: