bug 1431799 - add ship_fennec_rc relpro flavor. r=bhearsum draft
authorAki Sasaki <asasaki@mozilla.com>
Fri, 02 Feb 2018 14:50:38 -0800
changeset 750907 b87d4dd2394788a5452ff3f52a8ca5022a15b9ee
parent 750905 59d41887d856481ab85bb8d2221dfcebca4430b0
push id97783
push userasasaki@mozilla.com
push dateSat, 03 Feb 2018 04:24:29 +0000
reviewersbhearsum
bugs1431799, 1433536
milestone60.0a1
bug 1431799 - add ship_fennec_rc relpro flavor. r=bhearsum Also add rc-{google-play-track,rollout-percentage} for RC pushapk. One nice side effect of using the same push-apk kind: we don't re-run push-apk during the ship_fennec relpro flavor if we've run the ship_fennec_rc flavor with the same build. (Google Play would reject the same buildid.) This is really for bug 1433536, but MozReview is forcing me to include this patch with the others for reasons. MozReview-Commit-ID: 69ymqVLv9E2
taskcluster/ci/push-apk/kind.yml
taskcluster/ci/release-secondary-notify-ship/kind.yml
taskcluster/taskgraph/actions/release_promotion.py
taskcluster/taskgraph/target_tasks.py
taskcluster/taskgraph/transforms/push_apk.py
--- a/taskcluster/ci/push-apk/kind.yml
+++ b/taskcluster/ci/push-apk/kind.yml
@@ -32,30 +32,40 @@ jobs:
          upstream-artifacts:  # see transforms
          google-play-track:
             # See https://github.com/mozilla-releng/pushapkscript#aurora-beta-release-vs-alpha-beta-production
             by-project:
                mozilla-central: 'beta'
                mozilla-beta: 'rollout'
                mozilla-release: 'rollout'
                default: 'invalid'
+         rc-google-play-track:
+            by-project:
+               mozilla-release: 'rollout'
+               birch: 'rollout'
+               default: 'invalid'
          implementation: push-apk
          commit:
             by-project:
                mozilla-central: true
                mozilla-beta: true
                mozilla-release: true
                default: false
          rollout-percentage:
             by-project:
                # XXX Please make sure to change PUSH_APK_GOOGLE_PLAY_TRACT to
                # 'rollout' if you add a new supported project
                mozilla-release: 10
                mozilla-beta: 10
                default: null
+         rc-rollout-percentage:
+            by-project:
+               mozilla-release: 5
+               birch: 5
+               default: null
       requires: all-resolved
       scopes:  # see transforms
       treeherder:
          symbol: pub(gp)
          platform: Android/opt
          tier: 2
          kind: other
       run-on-projects: ['mozilla-central', 'mozilla-beta', 'mozilla-release', 'maple']
--- a/taskcluster/ci/release-secondary-notify-ship/kind.yml
+++ b/taskcluster/ci/release-secondary-notify-ship/kind.yml
@@ -5,16 +5,17 @@
 loader: taskgraph.loader.transform:loader
 
 transforms:
    - taskgraph.transforms.release_deps:transforms
    - taskgraph.transforms.task:transforms
 
 kind-dependencies:
    - release-secondary-balrog-publishing
+   - push-apk
 
 job-defaults:
    name: notify-release-drivers-ship
    description: Sends email to release-drivers telling release was shipped.
    run-on-projects: []
    shipping-phase: ship
    worker-type: aws-provisioner-v1/gecko-{level}-b-linux
    worker:
@@ -49,8 +50,12 @@ job-defaults:
             birch: birch
             default: unknown
 
 jobs:
    firefox-rc:
       shipping-product: firefox
       index:
          product: firefox
+   fennec-rc:
+      shipping-product: fennec
+      index:
+         product: fennec
--- a/taskcluster/taskgraph/actions/release_promotion.py
+++ b/taskcluster/taskgraph/actions/release_promotion.py
@@ -24,16 +24,21 @@ RELEASE_PROMOTION_CONFIG = {
     'promote_fennec': {
         'target_tasks_method': 'promote_fennec',
         'product': 'fennec',
     },
     'ship_fennec': {
         'target_tasks_method': 'ship_fennec',
         'product': 'fennec',
     },
+    'ship_fennec_rc': {
+        'target_tasks_method': 'ship_fennec',
+        'product': 'fennec',
+        'release_type': 'rc',
+    },
     'promote_firefox': {
         'target_tasks_method': 'promote_firefox',
         'product': 'firefox',
     },
     'push_firefox': {
         'target_tasks_method': 'push_firefox',
         'product': 'firefox',
     },
--- a/taskcluster/taskgraph/target_tasks.py
+++ b/taskcluster/taskgraph/target_tasks.py
@@ -497,27 +497,42 @@ def target_tasks_promote_fennec(full_tas
 
     return [l for l, t in full_task_graph.tasks.iteritems() if filter(full_task_graph[l])]
 
 
 @_target_task('ship_fennec')
 def target_tasks_ship_fennec(full_task_graph, parameters, graph_config):
     """Select the set of tasks required to ship fennec.
     Previous build deps will be optimized out via action task."""
+    is_rc = (parameters.get('release_type') == 'rc')
     filtered_for_candidates = target_tasks_promote_fennec(
         full_task_graph, parameters, graph_config,
     )
 
     def filter(task):
         # Include candidates build tasks; these will be optimized out
         if task.label in filtered_for_candidates:
             return True
-        if task.attributes.get('shipping_product') == 'fennec' and \
-                task.attributes.get('shipping_phase') in ('ship', 'push'):
-            return True
+        if task.attributes.get('shipping_product') != 'fennec' or \
+                task.attributes.get('shipping_phase') not in ('ship', 'push'):
+            return False
+        # We always run push-apk* during ship
+        if task.kind in (
+            'push-apk',
+            'push-apk-breakpoint',
+        ):
+                return True
+        # secondary-notify-ship is only for RC
+        if task.kind in (
+            'release-secondary-notify-ship',
+        ):
+            return is_rc
+
+        # Everything else is only for non-RC
+        return not is_rc
 
     return [l for l, t in full_task_graph.tasks.iteritems() if filter(full_task_graph[l])]
 
 
 @_target_task('pine_tasks')
 def target_tasks_pine(full_task_graph, parameters, graph_config):
     """Bug 1339179 - no mobile automation needed on pine"""
     def filter(task):
--- a/taskcluster/taskgraph/transforms/push_apk.py
+++ b/taskcluster/taskgraph/transforms/push_apk.py
@@ -56,16 +56,24 @@ transforms.add(validate_jobs_schema_tran
 transforms.add(validate_dependent_tasks_transform)
 
 
 @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'])
+
+        # Use the rc-google-play-track and rc-rollout-percentage in RC relpro flavors
+        if config.params['release_type'] == 'rc':
+            job['worker']['google-play-track'] = job['worker']['rc-google-play-track']
+            job['worker']['rollout-percentage'] = job['worker']['rc-rollout-percentage']
+        del(job['worker']['rc-google-play-track'])
+        del(job['worker']['rc-rollout-percentage'])
+
         resolve_keyed_by(
             job, 'worker.google-play-track', item_name=job['name'],
             project=config.params['project']
         )
         resolve_keyed_by(
             job, 'worker.commit', item_name=job['name'],
             project=config.params['project']
         )