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 Transform the update generation task into an actual task description.
8 from taskgraph
.transforms
.base
import TransformSequence
9 from taskgraph
.util
.schema
import resolve_keyed_by
11 transforms
= TransformSequence()
15 def handle_keyed_by(config
, tasks
):
16 """Resolve fields that can be keyed by platform, etc."""
17 if "merge_config" not in config
.params
:
19 merge_config
= config
.params
["merge_config"]
23 "worker.l10n-bump-info",
31 item_name
=task
["name"],
33 "project": config
.params
["project"],
34 "release-type": config
.params
["release_type"],
35 "behavior": merge_config
["behavior"],
42 def update_labels(config
, tasks
):
44 merge_config
= config
.params
["merge_config"]
45 task
["label"] = "merge-{}".format(merge_config
["behavior"])
46 treeherder
= task
.get("treeherder", {})
47 treeherder
["symbol"] = "Rel({})".format(merge_config
["behavior"])
48 task
["treeherder"] = treeherder
53 def add_payload_config(config
, tasks
):
55 if "merge_config" not in config
.params
:
57 merge_config
= config
.params
["merge_config"]
58 worker
= task
["worker"]
59 worker
["merge-info"] = config
.graph_config
["merge-automation"]["behaviors"][
60 merge_config
["behavior"]
63 if "l10n-bump-info" in worker
and worker
["l10n-bump-info"] is None:
64 del worker
["l10n-bump-info"]
66 # Override defaults, useful for testing.
74 if merge_config
.get(field
):
75 worker
["merge-info"][field
] = merge_config
[field
]
77 worker
["force-dry-run"] = merge_config
["force-dry-run"]
78 worker
["ssh-user"] = merge_config
.get("ssh-user-alias", "merge_user")
79 if merge_config
.get("push"):
80 worker
["push"] = merge_config
["push"]