1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 Apply some defaults and minor modifications to the jobs defined in the
6 APK and AAB signing kinds.
9 from taskgraph
.transforms
.base
import TransformSequence
10 from taskgraph
.util
.schema
import resolve_keyed_by
12 transforms
= TransformSequence()
14 PRODUCTION_SIGNING_BUILD_TYPES
= [
22 "fenix-beta-mozillaonline",
23 "fenix-release-mozillaonline",
28 def resolve_keys(config
, tasks
):
34 "treeherder.platform",
39 item_name
=task
["name"],
41 "build-type": task
["attributes"]["build-type"],
42 "level": config
.params
["level"],
49 def set_worker_type(config
, tasks
):
51 worker_type
= "linux-depsigning"
53 str(config
.params
["level"]) == "3"
54 and task
["attributes"]["build-type"] in PRODUCTION_SIGNING_BUILD_TYPES
56 worker_type
= "linux-signing"
57 task
["worker-type"] = worker_type
62 def add_signing_cert_scope(config
, tasks
):
63 scope_prefix
= config
.graph_config
["scriptworker"]["scope-prefix"]
66 if str(config
.params
["level"]) == "3":
67 if task
["attributes"]["build-type"] in ("fenix-beta", "fenix-release"):
68 cert
= "fennec-production-signing"
69 elif task
["attributes"]["build-type"] in PRODUCTION_SIGNING_BUILD_TYPES
:
70 cert
= "production-signing"
71 task
.setdefault("scopes", []).append(f
"{scope_prefix}:signing:cert:{cert}")
76 def set_index_job_name(config
, tasks
):
79 task
["index"]["job-name"] = task
["attributes"]["build-type"]
84 def set_signing_attributes(config
, tasks
):
86 task
["attributes"]["signed"] = True
91 def set_signing_format(config
, tasks
):
93 signing_format
= task
.pop("signing-format")
94 for upstream_artifact
in task
["worker"]["upstream-artifacts"]:
95 upstream_artifact
["formats"] = [signing_format
]
100 def format_email(config
, tasks
):
101 version
= config
.params
["version"]
105 email
= task
["notify"].get("email")
107 email
["subject"] = email
["subject"].format(version
=version
)
108 email
["content"] = email
["content"].format(version
=version
)