Backed out 3 changesets (bug 1870106, bug 1845276) for causing doc generate failures...
[gecko.git] / taskcluster / gecko_taskgraph / transforms / release_msix_push.py
blob22b356d5a20d98091b9d653a2b6e0962073982fa
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/.
4 """
5 Transform the release-msix-push kind into an actual task description.
6 """
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)
38 @transforms.add
39 def make_task_description(config, jobs):
40 for job in jobs:
41 job["worker"]["upstream-artifacts"] = generate_upstream_artifacts(
42 job["dependencies"]
45 resolve_keyed_by(
46 job,
47 "worker.channel",
48 item_name=job["name"],
49 **{"release-type": config.params["release_type"]},
51 resolve_keyed_by(
52 job,
53 "worker.publish-mode",
54 item_name=job["name"],
55 **{"release-type": config.params["release_type"]},
57 resolve_keyed_by(
58 job,
59 "worker-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(
65 add_scope_prefix(
66 config,
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"
76 yield job
79 def generate_upstream_artifacts(dependencies):
80 return [
82 "taskId": {"task-reference": f"<{task_kind}>"},
83 "taskType": "build",
84 "paths": ["public/build/target.store.msix"],
86 for task_kind in dependencies.keys()