From 66724b3aca3380ff723503540f91cb73108fd6f2 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Fri, 22 Sep 2017 14:25:28 -0400 Subject: [PATCH] Bug 1402457 - Add periodic file update task, but don't run it yet. r=dustin MozReview-Commit-ID: GD7qRLxwDn5 --HG-- extra : rebase_source : 7a4874f7229a69630cdd3e44815de682678cb1f2 --- taskcluster/ci/repo-update/kind.yml | 21 ++++++++ taskcluster/docs/kinds.rst | 5 ++ taskcluster/docs/transforms.rst | 1 + .../taskgraph/transforms/job/buildbot.py | 53 +++++++++++++++++++ taskcluster/taskgraph/transforms/task.py | 4 +- 5 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 taskcluster/ci/repo-update/kind.yml create mode 100644 taskcluster/taskgraph/transforms/job/buildbot.py diff --git a/taskcluster/ci/repo-update/kind.yml b/taskcluster/ci/repo-update/kind.yml new file mode 100644 index 000000000000..a1897a75fead --- /dev/null +++ b/taskcluster/ci/repo-update/kind.yml @@ -0,0 +1,21 @@ +# 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.job:transforms + - taskgraph.transforms.task:transforms + + +jobs: + hsts-hpkp-blocklist: + name: periodic_file_update + description: HSTS, HPKP, and Blocklist update + worker-type: buildbot-bridge/buildbot-bridge + run-on-projects: [] # Only run via cron + run: + using: buildbot + product: firefox + buildername: Linux x86-64 {branch} periodic file update diff --git a/taskcluster/docs/kinds.rst b/taskcluster/docs/kinds.rst index e55fb54b4009..c187822411d3 100644 --- a/taskcluster/docs/kinds.rst +++ b/taskcluster/docs/kinds.rst @@ -234,6 +234,11 @@ repackage-signing Repackage-signing take the repackaged installers (windows) and update packaging (with the signed internal bits) and signs them. +repo-update +----------- +Repo-Update tasks are tasks that perform some action on the project repo itself, +in order to update its state in some way. + partials -------- Partials takes the complete.mar files produced in previous tasks and generates partial diff --git a/taskcluster/docs/transforms.rst b/taskcluster/docs/transforms.rst index 009702f9f3ea..40dd087c43b8 100644 --- a/taskcluster/docs/transforms.rst +++ b/taskcluster/docs/transforms.rst @@ -137,6 +137,7 @@ part of the documentation. following ``run-using`` are available + * ``buildbot`` * ``hazard`` * ``mach`` * ``mozharness`` diff --git a/taskcluster/taskgraph/transforms/job/buildbot.py b/taskcluster/taskgraph/transforms/job/buildbot.py new file mode 100644 index 000000000000..89611f283f89 --- /dev/null +++ b/taskcluster/taskgraph/transforms/job/buildbot.py @@ -0,0 +1,53 @@ +# 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/. +""" + +Support for running jobs via buildbot. + +""" + +from __future__ import absolute_import, print_function, unicode_literals +import slugid + +from taskgraph.util.schema import Schema +from voluptuous import Required, Any + +from taskgraph.transforms.job import run_job_using + +buildbot_run_schema = Schema({ + Required('using'): 'buildbot', + + # the buildername to use for buildbot-bridge, will expand {branch} in name from + # the current project. + Required('buildername'): basestring, + + # the product to use + Required('product'): Any('firefox', 'mobile', 'devedition', 'thunderbird'), +}) + + +@run_job_using('buildbot-bridge', 'buildbot', schema=buildbot_run_schema) +def mozharness_on_buildbot_bridge(config, job, taskdesc): + run = job['run'] + worker = taskdesc['worker'] + branch = config.params['project'] + product = run['product'] + + worker.pop('env', None) + + buildername = run['buildername'].format(branch=branch) + + worker.update({ + 'buildername': buildername, + 'sourcestamp': { + 'branch': branch, + 'repository': config.params['head_repository'], + 'revision': config.params['head_rev'], + }, + 'properties': { + 'product': product, + 'who': config.params['owner'], + 'upload_to_task_id': slugid.nice(), + } + }) diff --git a/taskcluster/taskgraph/transforms/task.py b/taskcluster/taskgraph/transforms/task.py index 7d15eed60f51..399bb3a29138 100755 --- a/taskcluster/taskgraph/transforms/task.py +++ b/taskcluster/taskgraph/transforms/task.py @@ -977,8 +977,8 @@ def build_macosx_engine_payload(config, task, task_def): @payload_builder('buildbot-bridge') def build_buildbot_bridge_payload(config, task, task_def): - del task['extra']['treeherder'] - del task['extra']['treeherderEnv'] + task['extra'].pop('treeherder', None) + task['extra'].pop('treeherderEnv', None) worker = task['worker'] task_def['payload'] = { 'buildername': worker['buildername'],