Bug 1808605 - part 16: Port signing APK jobs

(cherry picked from commit a8ad379edbf43c0d2c6b0695e2f2dcac83ba3b2e)
pull/600/head
Geoff Brown 2 years ago committed by mergify[bot]
parent 33906fd9a9
commit 6c22aaafcd

@ -1,70 +0,0 @@
# 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: fenix_taskgraph.loader.multi_dep:loader
transforms:
- fenix_taskgraph.transforms.multi_dep:transforms
- fenix_taskgraph.transforms.signing:transforms
- fenix_taskgraph.transforms.notify:transforms
- taskgraph.transforms.task:transforms
kind-dependencies:
- build
primary-dependency: build
group-by: build-type
job-template:
description: Sign Fenix
worker: {}
signing-format:
by-build-type:
beta-mozillaonline: autograph_apk_mozillaonline
release-mozillaonline: autograph_apk_mozillaonline
default: autograph_apk
index:
by-tasks-for:
(action|cron):
by-build-type:
(nightly|debug|nightly-simulation|beta|beta-mozillaonline|release|release-mozillaonline):
type: signing
default: {}
default: {}
run-on-tasks-for:
by-build-type:
# No test job runs on push against this build type. Although we do want nightly-simulation
# signed to use it in the gecko trees.
# We want beta on push so that we detect problem before shipping it
(nightly-simulation|beta-firebase|android-test-beta|android-test-mozillaonline|nightly-firebase|android-test-nightly): [github-push]
default: []
treeherder:
job-symbol:
by-build-type:
android-test.+: Bats
android-test-mozillaonline: Bats-mo
beta-firebase: Bfs
nightly-firebase: Bfs
beta-mozillaonline: Bmos
release-mozillaonline: Bmos
default: Bs
kind: build
platform: android-all/opt
tier: 1
notify:
by-build-type:
.*(beta|release)-mozillaonline:
by-level:
'3':
email:
content: The Mozilla Online Fenix {version} APKs are now available
link:
text: Taskcluster Task
href: 'https://firefox-ci-tc.services.mozilla.com/tasks/${status.taskId}'
on-reasons: [completed]
subject: Mozilla Online Fenix {version} APKs are now available
to-addresses: [mozillaonline-fenix@mozilla.com]
default: {}
default: {}

@ -1,115 +0,0 @@
# 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/.
"""
Apply some defaults and minor modifications to the jobs defined in the build
kind.
"""
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:
for key in ("run-on-tasks-for", "signing-format", "notify"):
resolve_keyed_by(
task,
key,
item_name=task["name"],
**{
"build-type": task["attributes"]["build-type"],
"level": config.params["level"],
"tasks-for": config.params["tasks_for"],
}
)
yield task
@transforms.add
def set_worker_type(config, tasks):
for task in tasks:
worker_type = "dep-signing"
if (
str(config.params["level"]) == "3"
and task["attributes"]["build-type"]
in (
"nightly",
"beta",
"release",
"android-test-nightly",
"beta-mozillaonline",
"release-mozillaonline",
)
and config.params["tasks_for"] in ("cron", "action")
):
worker_type = "signing"
task["worker-type"] = worker_type
yield task
@transforms.add
def set_signing_type(config, tasks):
for task in tasks:
signing_type = "dep-signing"
if str(config.params["level"]) == "3" and config.params["tasks_for"] in (
"cron",
"action",
):
if task["attributes"]["build-type"] in ("beta", "release"):
signing_type = "fennec-production-signing"
elif task["attributes"]["build-type"] in (
"nightly",
"android-test-nightly",
"beta-mozillaonline",
"release-mozillaonline",
):
signing_type = "production-signing"
task.setdefault("worker", {})["signing-type"] = signing_type
yield task
@transforms.add
def set_index(config, tasks):
for task in tasks:
index = {}
if config.params["tasks_for"] in ("cron", "action") and task["attributes"][
"build-type"
] in ("nightly", "debut", "nightly-simulation", "beta", "release"):
index["type"] = "signing"
task["index"] = index
yield task
@transforms.add
def set_signing_attributes(config, tasks):
for task in tasks:
task["attributes"]["signed"] = True
yield task
@transforms.add
def set_signing_format(config, tasks):
for task in tasks:
signing_format = task.pop("signing-format")
for upstream_artifact in task["worker"]["upstream-artifacts"]:
upstream_artifact["formats"] = [signing_format]
yield task
@transforms.add
def format_email(config, tasks):
version = config.params["version"]
for task in tasks:
if "notify" in task:
email = task["notify"].get("email")
if email:
email["subject"] = email["subject"].format(version=version)
email["content"] = email["content"].format(version=version)
yield task
Loading…
Cancel
Save