diff options
Diffstat (limited to 'comm/taskcluster/comm_taskgraph/transforms/l10n_source_signing.py')
-rw-r--r-- | comm/taskcluster/comm_taskgraph/transforms/l10n_source_signing.py | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/comm/taskcluster/comm_taskgraph/transforms/l10n_source_signing.py b/comm/taskcluster/comm_taskgraph/transforms/l10n_source_signing.py new file mode 100644 index 0000000000..92a95cb612 --- /dev/null +++ b/comm/taskcluster/comm_taskgraph/transforms/l10n_source_signing.py @@ -0,0 +1,52 @@ +# 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/. +""" +Transform the signing task into an actual task description. +""" + +from taskgraph.transforms.base import TransformSequence +from taskgraph.util.taskcluster import get_artifact_path + +from gecko_taskgraph.transforms.build_signing import add_signed_routes +from gecko_taskgraph.util.attributes import copy_attributes_from_dependent_job + +transforms = TransformSequence() + +transforms.add(add_signed_routes) + + +@transforms.add +def define_upstream_artifacts(config, jobs): + for job in jobs: + dep_job = job["primary-dependency"] + upstream_artifact_task = job.pop("upstream-artifact-task", dep_job) + + job["attributes"] = copy_attributes_from_dependent_job(dep_job) + + artifacts_specifications = [ + { + "artifacts": [ + get_artifact_path(job, "strings_all.tar.zst"), + get_artifact_path(job, "l10n-changesets.json"), + ], + "formats": ["autograph_gpg"], + } + ] + + task_ref = f"<{upstream_artifact_task.kind}>" + task_type = "build" + if "notarization" in upstream_artifact_task.kind: + task_type = "scriptworker" + + job["upstream-artifacts"] = [ + { + "taskId": {"task-reference": task_ref}, + "taskType": task_type, + "paths": spec["artifacts"], + "formats": spec["formats"], + } + for spec in artifacts_specifications + ] + + yield job |