Bug 1659691 - automation to run l10n-cross-channel in taskgraph cron. r=taskgraph-reviewers,jmaher

Differential Revision: https://phabricator.services.mozilla.com/D117253
This commit is contained in:
Aki Sasaki 2021-06-17 18:52:58 +00:00
parent 5b64d5df25
commit 494511b9d2
5 changed files with 114 additions and 0 deletions

View File

@ -315,3 +315,15 @@ jobs:
action-name: scriptworker-canary
include-cron-input: true
when: [] # never (hook only)
- name: l10n-cross-channel
job:
type: decision-task
treeherder-symbol: l10n-cross-channel
target-tasks-method: l10n-cross-channel
run-on-projects:
- mozilla-central
when:
by-project:
mozilla-central: [{hour: 8, minute: 0}, {hour: 20, minute: 0}]
default: []

View File

@ -0,0 +1,41 @@
# 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.cross_channel:transforms
- taskgraph.transforms.job:transforms
- taskgraph.transforms.task:transforms
jobs:
quarantine:
description: Push strings from all shipping trains to the quarantine strings repo
run-on-projects: []
worker-type: b-linux
ssh-key-secret:
by-level:
"3": project/releng/gecko/build/level-3/l10n-cross-channel-quarantine-ssh
default: null
worker:
docker-image: {in-tree: push-to-try}
max-run-time: 3600
artifacts:
- type: directory
name: public/build
path: /builds/worker/artifacts
env:
TASK_ID: {"task-reference": "<self>"}
TASKCLUSTER_PROXY_URL: http://taskcluster
treeherder:
platform: firefox-release/opt
tier: 1
kind: build
symbol: Rel(l10n-cross-channel)
run:
using: mach
actions:
by-level:
"3": ["prep", "create", "push"]
default: ["prep", "create"]

View File

@ -729,3 +729,9 @@ startup-test
------------
Runs Firefox for a short period of time to see if it crashes
l10n-cross-channel
------------------
Compiles a set of en-US strings from all shipping release trains and pushes to
the quarantine strings repo.

View File

@ -1198,3 +1198,13 @@ def target_tasks_perftest_autoland(full_task_graph, parameters, graph_config):
test_name in name for test_name in ["view"]
):
yield name
@_target_task("l10n-cross-channel")
def target_tasks_l10n_cross_channel(full_task_graph, parameters, graph_config):
"""Select the set of tasks required to run l10n cross-channel."""
def filter(task):
return task.kind in ["l10n-cross-channel"]
return [l for l, t in six.iteritems(full_task_graph.tasks) if filter(t)]

View File

@ -0,0 +1,45 @@
# 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/.
"""
Build a command to run `mach l10n-cross-channel`.
"""
from __future__ import absolute_import, print_function, unicode_literals
from pipes import quote as shell_quote
from taskgraph.transforms.base import TransformSequence
from taskgraph.util.schema import resolve_keyed_by
transforms = TransformSequence()
@transforms.add
def resolve_keys(config, jobs):
for job in jobs:
for item in ["ssh-key-secret", "run.actions"]:
resolve_keyed_by(job, item, item, **{"level": str(config.params["level"])})
yield job
@transforms.add
def build_command(config, jobs):
for job in jobs:
command = [
"l10n-cross-channel",
"-o",
"/builds/worker/artifacts/outgoing.diff",
"--attempts",
"5",
]
ssh_key_secret = job.pop("ssh-key-secret")
if ssh_key_secret:
command.extend(["--ssh-secret", ssh_key_secret])
job.setdefault("scopes", []).append("secrets:get:{}".format(ssh_key_secret))
command.extend(job["run"].pop("actions", []))
job.setdefault("run", {}).update(
{"using": "mach", "mach": " ".join(map(shell_quote, command))}
)
yield job