Bug 1436369 - Run blocklist updates on mozilla-beta. r=jlorenzo, a=release
authorSimon Fraser <sfraser@mozilla.com>
Fri, 01 Jun 2018 14:13:44 +0100
changeset 471180 137cbb0160ba4627c2fa672ed691eb63d923279d
parent 471179 d45bd3bcab72649072fde981062a1b33dd7c65f5
child 471181 51c9cec9f82e55409277981d49a16022991ce449
push id9320
push userryanvm@gmail.com
push dateWed, 06 Jun 2018 13:41:07 +0000
treeherdermozilla-beta@51c9cec9f82e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlorenzo, release
bugs1436369
milestone61.0
Bug 1436369 - Run blocklist updates on mozilla-beta. r=jlorenzo, a=release 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
@@ -115,8 +115,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,44 @@
 # 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: ""
+         USE_MOZILLA_CENTRAL:
+            by-project:
+               mozilla-central: "1"
+               default: ""
+
+
 jobs:
    hsts-hpkp-blocklist:
       name: periodic_file_update
       description: HSTS, HPKP, and Blocklist update
       run-on-projects: []  # Only run via cron
       treeherder:
          kind: build
          platform: linux64/opt
@@ -20,21 +46,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"
-            USE_MOZILLA_CENTRAL: "1"
-            BRANCH: mozilla-central
             PRODUCT: firefox
             REVIEWERS: sfraser
          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