Bug 1436369 Run blocklist updates on mozilla-beta r=jlorenzo
authorSimon Fraser <sfraser@mozilla.com>
Fri, 01 Jun 2018 14:13:44 +0100
changeset 802862 e942cbff958854dbbfbce40c295634bdf3502037
parent 802861 178ac5165152f8a0978bf0740735da03122052d5
child 802863 75bae63efb9e97807d2fc45d283e0f54e1e7be31
push id111983
push userbmo:gl@mozilla.com
push dateFri, 01 Jun 2018 15:03:54 +0000
reviewersjlorenzo
bugs1436369
milestone62.0a1
Bug 1436369 Run blocklist updates on mozilla-beta r=jlorenzo Summary: the blocklist and remote-settings changes need to happen on beta, but not the hsts/hpkp updates, so we have to split out the control of what runs by project. Reviewers: jlorenzo Reviewed By: jlorenzo Bug #: 1436369 Differential Revision: https://phabricator.services.mozilla.com/D1487
.cron.yml
taskcluster/ci/repo-update/kind.yml
taskcluster/taskgraph/transforms/repo_update.py
--- a/.cron.yml
+++ b/.cron.yml
@@ -113,8 +113,11 @@ jobs:
           by-project:
               # No default branch
               mozilla-central:
                   - {weekday: 'Monday', hour: 10, minute: 0}
                   - {weekday: 'Thursday', hour: 10, minute: 0}
               mozilla-esr60:
                   - {weekday: 'Monday', hour: 10, minute: 0}
                   - {weekday: 'Thursday', hour: 10, minute: 0}
+              mozilla-beta:
+                  - {weekday: 'Monday', hour: 10, minute: 0}
+                  - {weekday: 'Thursday', hour: 10, minute: 0}
--- a/taskcluster/ci/repo-update/kind.yml
+++ b/taskcluster/ci/repo-update/kind.yml
@@ -1,18 +1,50 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 loader: taskgraph.loader.transform:loader
 
 transforms:
+   - taskgraph.transforms.repo_update:transforms
    - taskgraph.transforms.task:transforms
 
 
+job-defaults:
+   worker:
+      env:
+         DO_HSTS:
+            by-project:
+               mozilla-central: "1"
+               mozilla-esr60: "1"
+               default: ""
+         DO_HPKP:
+            by-project:
+               mozilla-central: "1"
+               mozilla-esr60: "1"
+               default: ""
+         DO_BLOCKLIST:
+            by-project:
+               mozilla-central: "1"
+               mozilla-esr60: "1"
+               mozilla-beta: "1"
+               default: ""
+         DO_REMOTE_SETTINGS:
+            by-project:
+               mozilla-central: "1"
+               mozilla-esr60: "1"
+               mozilla-beta: "1"
+               default: ""
+         USE_MOZILLA_CENTRAL:
+            by-project:
+               mozilla-central: "1"
+               default: ""
+
+
 jobs:
    hsts-hpkp-blocklist:
       name: periodic_file_update
       description: HSTS, HPKP, Blocklist and remote settings update
       run-on-projects: []  # Only run via cron
       treeherder:
          kind: build
          platform: linux64/opt
@@ -20,22 +52,16 @@ jobs:
          tier: 1
       worker-type: aws-provisioner-v1/gecko-{level}-b-linux
       worker:
          implementation: docker-worker
          os: linux
          docker-image: {in-tree: periodic-updates}
          max-run-time: 3600  # Sometimes takes ~40 minutes
          env:
-            DO_HSTS: "1"
-            DO_HPKP: "1"
-            DO_BLOCKLIST: "1"
-            DO_REMOTE_SETTINGS: "1"
-            USE_MOZILLA_CENTRAL: "1"
-            BRANCH: mozilla-central
             PRODUCT: firefox
             REVIEWERS: "mtabara, jlund"
          command:
             - /runme.sh
          taskcluster-proxy: true
          artifacts:
             - name: 'public/build/nsSTSPreloadList.diff'
               path: '/home/worker/artifacts/nsSTSPreloadList.diff'
new file mode 100644
--- /dev/null
+++ b/taskcluster/taskgraph/transforms/repo_update.py
@@ -0,0 +1,27 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+"""
+Transform the repo-update 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 resolve_keyed_by
+
+transforms = TransformSequence()
+
+
+@transforms.add
+def resolve_keys(config, tasks):
+    for task in tasks:
+        env = task['worker'].setdefault('env', {})
+        env['BRANCH'] = config.params['project']
+        for envvar in env:
+            resolve_keyed_by(env, envvar, envvar, **config.params)
+
+        for envvar in list(env.keys()):
+            if not env.get(envvar):
+                del env[envvar]
+        yield task