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 release-msix-push kind into an actual task description.
8 from taskgraph
.transforms
.base
import TransformSequence
9 from taskgraph
.util
.schema
import Schema
, optionally_keyed_by
, resolve_keyed_by
10 from voluptuous
import Optional
, Required
12 from gecko_taskgraph
.transforms
.task
import task_description_schema
13 from gecko_taskgraph
.util
.attributes
import release_level
14 from gecko_taskgraph
.util
.scriptworker
import add_scope_prefix
16 push_msix_description_schema
= Schema(
18 Required("name"): str,
19 Required("job-from"): task_description_schema
["job-from"],
20 Required("dependencies"): task_description_schema
["dependencies"],
21 Required("description"): task_description_schema
["description"],
22 Required("treeherder"): task_description_schema
["treeherder"],
23 Required("run-on-projects"): task_description_schema
["run-on-projects"],
24 Required("worker-type"): optionally_keyed_by("release-level", str),
25 Required("worker"): object,
26 Optional("scopes"): [str],
27 Required("shipping-phase"): task_description_schema
["shipping-phase"],
28 Required("shipping-product"): task_description_schema
["shipping-product"],
29 Optional("extra"): task_description_schema
["extra"],
30 Optional("attributes"): task_description_schema
["attributes"],
34 transforms
= TransformSequence()
35 transforms
.add_validate(push_msix_description_schema
)
39 def make_task_description(config
, jobs
):
41 job
["worker"]["upstream-artifacts"] = generate_upstream_artifacts(
48 item_name
=job
["name"],
49 **{"release-type": config
.params
["release_type"]},
53 "worker.publish-mode",
54 item_name
=job
["name"],
55 **{"release-type": config
.params
["release_type"]},
60 item_name
=job
["name"],
61 **{"release-level": release_level(config
.params
["project"])},
63 if release_level(config
.params
["project"]) == "production":
64 job
.setdefault("scopes", []).append(
67 "microsoftstore:{}".format(job
["worker"]["channel"]),
71 # Override shipping-phase for release: push to the Store early to
72 # allow time for certification.
73 if job
["worker"]["publish-mode"] == "Manual":
74 job
["shipping-phase"] = "promote"
79 def generate_upstream_artifacts(dependencies
):
82 "taskId": {"task-reference": f
"<{task_kind}>"},
84 "paths": ["public/build/target.store.msix"],
86 for task_kind
in dependencies
.keys()