From 2dafd2dcea359d1da7cc65313ef8cb5d08a2806e Mon Sep 17 00:00:00 2001 From: "Ben Hearsum (he/him)" Date: Mon, 14 Jun 2021 14:07:02 -0400 Subject: [PATCH] [fenix] RELENG-588: Add notifications for Mozilla Online builds (https://github.com/mozilla-mobile/fenix/pull/20010) --- taskcluster/ci/signing/kind.yml | 16 ++++++++++++++++ .../fenix_taskgraph/transforms/signing.py | 16 +++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/taskcluster/ci/signing/kind.yml b/taskcluster/ci/signing/kind.yml index 25ec5cc0a6..0b5e2c9336 100644 --- a/taskcluster/ci/signing/kind.yml +++ b/taskcluster/ci/signing/kind.yml @@ -7,6 +7,7 @@ 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: @@ -52,3 +53,18 @@ job-template: kind: build platform: android-all/opt tier: 1 + notify: + by-build-type: + .*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: {} diff --git a/taskcluster/fenix_taskgraph/transforms/signing.py b/taskcluster/fenix_taskgraph/transforms/signing.py index f13f261e0f..e8713ab80a 100644 --- a/taskcluster/fenix_taskgraph/transforms/signing.py +++ b/taskcluster/fenix_taskgraph/transforms/signing.py @@ -18,7 +18,7 @@ transforms = TransformSequence() @transforms.add def resolve_keys(config, tasks): for task in tasks: - for key in ("run-on-tasks-for", "signing-format"): + for key in ("run-on-tasks-for", "signing-format", "notify"): resolve_keyed_by( task, key, @@ -90,3 +90,17 @@ def set_signing_format(config, tasks): 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