bug 1477021: create pipfile-update task for funsize-update-generator. r=sfraser

--HG--
extra : rebase_source : 8a7bc1b481b6d477dc6b1ea6a0bd392e73f16f74
This commit is contained in:
Ben Hearsum 2018-07-26 08:56:08 -04:00
Родитель 9d82e727e0
Коммит 49d4d780ee
5 изменённых файлов: 87 добавлений и 0 удалений

Просмотреть файл

@ -70,6 +70,7 @@ treeherder:
'langpack': 'Langpack sigatures and uploads'
'TPS': 'Sync tests'
'UV': 'Update verify'
'pipfu': 'pipfile update'
index:
products:

Просмотреть файл

@ -0,0 +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.pipfile_update:transforms
- taskgraph.transforms.task:transforms
job-defaults:
name: pipfile_update
description: Update Pipfile.lock
run-on-projects: []
treeherder:
kind: build
platform: linux64/opt
tier: 1
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
implementation: docker-worker
os: linux
docker-image: {in-tree: pipfile-updates}
max-run-time: 2400
command:
- /runme.sh
artifacts:
- name: 'public/build/Pipfile.lock.diff'
path: '/home/worker/artifacts/Pipfile.lock.diff'
type: file
scopes:
- secrets:get:project/releng/gecko/build/level-{level}/arc-phabricator-token
jobs:
funsize-update-generator:
treeherder:
symbol: pipfu(fug)
worker:
env:
PIPFILE_DIRECTORY: "taskcluster/docker/funsize-update-generator"
PYTHON3: "1"
REVIEWERS: "sfraser, bhearsum"

Просмотреть файл

@ -448,6 +448,11 @@ 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.
pipfile-update
--------------
Pipfile-update tasks generate update Pipfile.lock for in-tree Pipfiles, and attach
patches with the updates to Phabricator.
partials
--------
Partials takes the complete.mar files produced in previous tasks and generates partial

Просмотреть файл

@ -572,6 +572,16 @@ def target_tasks_searchfox(full_task_graph, parameters, graph_config):
'searchfox-macosx64-searchfox/debug']
@_target_task('pipfile_update')
def target_tasks_pipfile_update(full_task_graph, parameters, graph_config):
"""Select the set of tasks required to perform nightly in-tree pipfile updates
"""
def filter(task):
# For now any task in the repo-update kind is ok
return task.kind in ['pipfile-update']
return [l for l, t in full_task_graph.tasks.iteritems() if filter(t)]
@_target_task('file_update')
def target_tasks_file_update(full_task_graph, parameters, graph_config):
"""Select the set of tasks required to perform nightly in-tree file updates

Просмотреть файл

@ -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