Skip to content

Commit

Permalink
Bug 1659691 - automation to run l10n-cross-channel in taskgraph cron.…
Browse files Browse the repository at this point in the history
… r=taskgraph-reviewers,jmaher

Differential Revision: https://phabricator.services.mozilla.com/D117253
  • Loading branch information
escapewindow committed Jun 17, 2021
1 parent 5b64d5d commit 494511b
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
41 changes: 41 additions & 0 deletions taskcluster/ci/l10n-cross-channel/kind.yml
Original file line number Diff line number Diff line change
@@ -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"]
6 changes: 6 additions & 0 deletions taskcluster/docs/kinds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
10 changes: 10 additions & 0 deletions taskcluster/taskgraph/target_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
45 changes: 45 additions & 0 deletions taskcluster/taskgraph/transforms/cross_channel.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 494511b

Please sign in to comment.