diff --git a/.taskcluster.yml b/.taskcluster.yml index c43c2e1..e508632 100644 --- a/.taskcluster.yml +++ b/.taskcluster.yml @@ -186,7 +186,7 @@ tasks: taskclusterProxy: true chainOfTrust: true - image: mozillareleases/taskgraph:decision-cf4b4b4baff57d84c1f9ec8fcd70c9839b70a7d66e6430a6c41ffe67252faa19@sha256:425e07f6813804483bc5a7258288a7684d182617ceeaa0176901ccc7702dfe28 + image: mozillareleases/taskgraph:decision-8af16934fd68303cebf9735705515cb48df542d251c04e921c7ac50564faac32@sha256:2965f42c2e91fc66ae7bd27d5dff88297225a90d04ebc6de23c538e3933d4049 maxRunTime: 1800 diff --git a/taskcluster/ci/addons-linter/kind.yml b/taskcluster/ci/addons-linter/kind.yml index 8d70416..90ed0a5 100644 --- a/taskcluster/ci/addons-linter/kind.yml +++ b/taskcluster/ci/addons-linter/kind.yml @@ -12,7 +12,7 @@ transforms: - taskgraph.transforms.job:transforms - taskgraph.transforms.task:transforms -job-template: +task-template: description: Run addons-linter worker-type: b-linux # We only want to execute addons-linter on privileged extensions (for now). diff --git a/taskcluster/ci/balrog/kind.yml b/taskcluster/ci/balrog/kind.yml index c35aac4..b4d1ea5 100644 --- a/taskcluster/ci/balrog/kind.yml +++ b/taskcluster/ci/balrog/kind.yml @@ -10,7 +10,7 @@ kind-dependencies: only-for-addon-types: ["system"] -job-template: +task-template: run-on-tasks-for: ["action"] worker-type: balrog balrog: diff --git a/taskcluster/ci/beetmover/kind.yml b/taskcluster/ci/beetmover/kind.yml index 1c919f9..f8fbdee 100644 --- a/taskcluster/ci/beetmover/kind.yml +++ b/taskcluster/ci/beetmover/kind.yml @@ -13,7 +13,7 @@ kind-dependencies: only-for-addon-types: ["system"] -job-template: +task-template: run-on-tasks-for: ["action"] worker-type: beetmover attributes: diff --git a/taskcluster/ci/build/kind.yml b/taskcluster/ci/build/kind.yml index 8909b41..16abb79 100644 --- a/taskcluster/ci/build/kind.yml +++ b/taskcluster/ci/build/kind.yml @@ -11,7 +11,7 @@ transforms: - taskgraph.transforms.job:transforms - taskgraph.transforms.task:transforms -job-defaults: +task-defaults: description: Build XPI from source code. worker-type: b-linux worker: @@ -21,7 +21,7 @@ job-defaults: run: use-caches: false -jobs: +tasks: release: attributes: shipping-phase: build diff --git a/taskcluster/ci/dep-signing/kind.yml b/taskcluster/ci/dep-signing/kind.yml index 8f0dd63..8742ea6 100644 --- a/taskcluster/ci/dep-signing/kind.yml +++ b/taskcluster/ci/dep-signing/kind.yml @@ -14,7 +14,7 @@ transforms: - taskgraph.transforms.cached_tasks:transforms - taskgraph.transforms.task:transforms -job-template: +task-template: description: Development-sign XPI index: type: dep-signing diff --git a/taskcluster/ci/docker-image/kind.yml b/taskcluster/ci/docker-image/kind.yml index a611b29..63f5b1b 100644 --- a/taskcluster/ci/docker-image/kind.yml +++ b/taskcluster/ci/docker-image/kind.yml @@ -10,7 +10,7 @@ transforms: - taskgraph.transforms.cached_tasks:transforms - taskgraph.transforms.task:transforms -jobs: +tasks: node-latest: definition: node args: diff --git a/taskcluster/ci/pr/kind.yml b/taskcluster/ci/pr/kind.yml index 9f10412..87d52ca 100644 --- a/taskcluster/ci/pr/kind.yml +++ b/taskcluster/ci/pr/kind.yml @@ -12,7 +12,7 @@ transforms: - taskgraph.transforms.code_review:transforms - taskgraph.transforms.task:transforms -jobs: +tasks: complete: description: PR Summary Task run-on-tasks-for: [github-pull-request] diff --git a/taskcluster/ci/release-github/kind.yml b/taskcluster/ci/release-github/kind.yml index ae959af..57281a2 100644 --- a/taskcluster/ci/release-github/kind.yml +++ b/taskcluster/ci/release-github/kind.yml @@ -11,7 +11,7 @@ transforms: kind-dependencies: - release-signing -job-template: +task-template: name: release-github description: upload release artifacts to github and publish run-on-tasks-for: ["action"] diff --git a/taskcluster/ci/release-mark-as-shipped/kind.yml b/taskcluster/ci/release-mark-as-shipped/kind.yml index 994e815..4129e97 100644 --- a/taskcluster/ci/release-mark-as-shipped/kind.yml +++ b/taskcluster/ci/release-mark-as-shipped/kind.yml @@ -17,7 +17,7 @@ kind-dependencies: group-by: addon-type -job-template: +task-template: name: release-mark-as-shipped description: mark release as shipped in Ship-It run-on-tasks-for: ["action"] diff --git a/taskcluster/ci/release-notify-completed/kind.yml b/taskcluster/ci/release-notify-completed/kind.yml index 936f8fd..dc7ad9b 100644 --- a/taskcluster/ci/release-notify-completed/kind.yml +++ b/taskcluster/ci/release-notify-completed/kind.yml @@ -13,7 +13,7 @@ kind-dependencies: - release-signing - release-mark-as-shipped -job-template: +task-template: name: release-notify-completed description: Sends email to the notify list telling release was completed. run-on-tasks-for: ["action"] diff --git a/taskcluster/ci/release-notify-started/kind.yml b/taskcluster/ci/release-notify-started/kind.yml index d8aa3f3..3978342 100644 --- a/taskcluster/ci/release-notify-started/kind.yml +++ b/taskcluster/ci/release-notify-started/kind.yml @@ -8,7 +8,7 @@ transforms: - xpi_taskgraph.transforms.release_notifications:transforms - taskgraph.transforms.task:transforms -job-defaults: +task-defaults: name: release-notify-started description: Sends email to the notify list telling release was started. run-on-tasks-for: ["action"] @@ -16,7 +16,7 @@ job-defaults: worker: implementation: succeed -jobs: +tasks: build: attributes: shipping-phase: build diff --git a/taskcluster/ci/release-signing/kind.yml b/taskcluster/ci/release-signing/kind.yml index f0505f2..9c9e8ad 100644 --- a/taskcluster/ci/release-signing/kind.yml +++ b/taskcluster/ci/release-signing/kind.yml @@ -15,7 +15,7 @@ transforms: - xpi_taskgraph.transforms.signing:transforms - taskgraph.transforms.task:transforms -job-template: +task-template: description: Release-sign XPI index: type: release-signing diff --git a/taskcluster/ci/test/kind.yml b/taskcluster/ci/test/kind.yml index eee9b78..27fe788 100644 --- a/taskcluster/ci/test/kind.yml +++ b/taskcluster/ci/test/kind.yml @@ -12,7 +12,7 @@ transforms: - taskgraph.transforms.job:transforms - taskgraph.transforms.task:transforms -job-template: +task-template: description: Test XPI worker-type: b-linux worker: diff --git a/taskcluster/requirements.in b/taskcluster/requirements.in index 6cb1992..6019de7 100644 --- a/taskcluster/requirements.in +++ b/taskcluster/requirements.in @@ -1,4 +1,4 @@ # For instructions on managing dependencies, see: # https://taskcluster-taskgraph.readthedocs.io/en/latest/howto/bootstrap-taskgraph.html -taskcluster-taskgraph>=1.3.0 \ No newline at end of file +taskcluster-taskgraph>=4.1.1 \ No newline at end of file diff --git a/taskcluster/requirements.txt b/taskcluster/requirements.txt index aa3e68c..1053e8a 100644 --- a/taskcluster/requirements.txt +++ b/taskcluster/requirements.txt @@ -1,6 +1,6 @@ # -# This file is autogenerated by pip-compile with python 3.9 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.9 +# by the following command: # # pip-compile --generate-hashes --output-file=requirements.txt requirements.in # @@ -8,26 +8,36 @@ appdirs==1.4.4 \ --hash=sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41 \ --hash=sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128 # via taskcluster-taskgraph -attrs==21.4.0 \ - --hash=sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4 \ - --hash=sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd +attrs==22.1.0 \ + --hash=sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6 \ + --hash=sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c # via taskcluster-taskgraph -certifi==2021.10.8 \ - --hash=sha256:78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872 \ - --hash=sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569 +certifi==2022.9.24 \ + --hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14 \ + --hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382 # via requests -charset-normalizer==2.0.12 \ - --hash=sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597 \ - --hash=sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df +charset-normalizer==2.1.1 \ + --hash=sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845 \ + --hash=sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f # via requests -idna==3.3 \ - --hash=sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff \ - --hash=sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d +giturlparse==0.10.0 \ + --hash=sha256:04ba1a3a099c3093fa8d24a422913c6a9b2c2cd22bcffc939cf72e3e98f672d7 \ + --hash=sha256:2595ab291d30717cda8474b874c9fd509f1b9802ad7f6968c36a45e4b13eb337 + # via mozilla-repo-urls +idna==3.4 \ + --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ + --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 # via requests json-e==4.4.3 \ + --hash=sha256:604cc506746ece244e5f4c66ce1b77887b0340749f9f10f58f311caf5701315f \ --hash=sha256:8ed3974faa887ca96a7987298f6550cf2ad35472419a980766b3abe48258de0a # via taskcluster-taskgraph +mozilla-repo-urls==0.1.1 \ + --hash=sha256:30510d3519479aa70211145d0ac9cf6e2fadcb8d30fa3b196bb957bd773502ba \ + --hash=sha256:7364da790751db2a060eb45adbf1d7db89a145ed279ba235f3425db9dd255915 + # via taskcluster-taskgraph pyyaml==6.0 \ + --hash=sha256:01b45c0191e6d66c470b6cf1b9531a771a83c1c4208272ead47a3ae4f2f603bf \ --hash=sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293 \ --hash=sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b \ --hash=sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57 \ @@ -39,35 +49,42 @@ pyyaml==6.0 \ --hash=sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287 \ --hash=sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513 \ --hash=sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0 \ + --hash=sha256:432557aa2c09802be39460360ddffd48156e30721f5e8d917f01d31694216782 \ --hash=sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0 \ --hash=sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92 \ --hash=sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f \ --hash=sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2 \ --hash=sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc \ + --hash=sha256:81957921f441d50af23654aa6c5e5eaf9b06aba7f0a19c18a538dc7ef291c5a1 \ --hash=sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c \ --hash=sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86 \ --hash=sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4 \ --hash=sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c \ --hash=sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34 \ --hash=sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b \ + --hash=sha256:afa17f5bc4d1b10afd4466fd3a44dc0e245382deca5b3c353d8b757f9e3ecb8d \ --hash=sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c \ --hash=sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb \ + --hash=sha256:bfaef573a63ba8923503d27530362590ff4f576c626d86a9fed95822a8255fd7 \ --hash=sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737 \ --hash=sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3 \ --hash=sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d \ + --hash=sha256:d4b0ba9512519522b118090257be113b9468d804b19d63c71dbcf4a48fa32358 \ --hash=sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53 \ --hash=sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78 \ --hash=sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803 \ --hash=sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a \ + --hash=sha256:dbad0e9d368bb989f4515da330b88a057617d16b6a8245084f1b05400f24609f \ --hash=sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174 \ --hash=sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5 # via taskcluster-taskgraph redo==2.0.4 \ - --hash=sha256:81066955041c853b0e6491eb65a0877dce45131c4cfa3d42d923fc2aa8f7a043 + --hash=sha256:81066955041c853b0e6491eb65a0877dce45131c4cfa3d42d923fc2aa8f7a043 \ + --hash=sha256:c76e4c23ab2f8840261736a851323cd98493710e7a9d36a1058535dca501f293 # via taskcluster-taskgraph -requests==2.27.1 \ - --hash=sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61 \ - --hash=sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d +requests==2.28.1 \ + --hash=sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983 \ + --hash=sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349 # via # requests-unixsocket # taskcluster-taskgraph @@ -79,19 +96,20 @@ slugid==2.0.0 \ --hash=sha256:a950d98b72691178bdd4d6c52743c4a2aa039207cf7a97d71060a111ff9ba297 \ --hash=sha256:aec8b0e01c4ad32e38e12d609eab3ec912fd129aaf6b2ded0199b56a5f8fd67c # via taskcluster-taskgraph -taskcluster-taskgraph==1.3.0 \ - --hash=sha256:a1050f8a613e31fcd7bc4fed85e07e57baa5675a5a5719065caebada533eb8f5 \ - --hash=sha256:bd3c35d82296c323064c8b6e6d4a88ab186bcd872bdd930bfe734a0b2525a082 +taskcluster-taskgraph==4.1.1 \ + --hash=sha256:757c8886dac97dcf7100e7311fe917f9fd4f4fa88c46d954f0682bd96c07f61e \ + --hash=sha256:fd177b0172f8b6a93e4f5da69dbdd4e05a2ef4615ed66d44f2dbb3197610202d # via -r requirements.in taskcluster-urls==13.0.1 \ --hash=sha256:5e25e7e6818e8877178b175ff43d2e6548afad72694aa125f404a7329ece0973 \ --hash=sha256:b25e122ecec249c4299ac7b20b08db76e3e2025bdaeb699a9d444556de5fd367 \ --hash=sha256:f66dcbd6572a6216ab65949f0fa0b91f2df647918028436c384e6af5cd12ae2b # via taskcluster-taskgraph -urllib3==1.26.9 \ - --hash=sha256:44ece4d53fb1706f667c9bd1c648f5469a2ec925fcf3a776667042d645472c14 \ - --hash=sha256:aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e +urllib3==1.26.13 \ + --hash=sha256:47cc05d99aaa09c9e72ed5809b60e7ba354e64b59c9c173ac3018642d8bb41fc \ + --hash=sha256:c083dd0dce68dbfbe1129d5271cb90f9447dea7d52097c6e0126120c521ddea8 # via requests -voluptuous==0.12.2 \ - --hash=sha256:4db1ac5079db9249820d49c891cb4660a6f8cae350491210abce741fabf56513 +voluptuous==0.13.1 \ + --hash=sha256:4b838b185f5951f2d6e8752b68fcf18bd7a9c26ded8f143f92d6d28f3921a3e6 \ + --hash=sha256:e8d31c20601d6773cb14d4c0f42aee29c6821bbd1018039aac7ac5605b489723 # via taskcluster-taskgraph diff --git a/taskcluster/xpi_taskgraph/loader/multi_dep.py b/taskcluster/xpi_taskgraph/loader/multi_dep.py index a961625..4e8e18c 100644 --- a/taskcluster/xpi_taskgraph/loader/multi_dep.py +++ b/taskcluster/xpi_taskgraph/loader/multi_dep.py @@ -6,7 +6,6 @@ import copy from taskgraph.task import Task -from taskgraph.util.attributes import sorted_unique_list from taskgraph.util.schema import Schema from voluptuous import Required @@ -66,7 +65,7 @@ def group_tasks(config, tasks): def loader(kind, path, config, params, loaded_tasks): - job_template = config.get("job-template") + task_template = config.get("task-template") for dep_tasks in group_tasks(config, loaded_tasks): kinds = [dep.kind for dep in dep_tasks] kinds_occurrences = {kind: kinds.count(kind) for kind in kinds} @@ -77,21 +76,21 @@ def loader(kind, path, config, params, loaded_tasks): primary_dep = get_primary_dep(config, dep_tasks_per_unique_key) - job = {"primary-dependency": primary_dep} - if job_template: - job.update(copy.deepcopy(job_template)) - job["dependencies"] = { + task = {"primary-dependency": primary_dep} + if task_template: + task.update(copy.deepcopy(task_template)) + task["dependencies"] = { dep_key: dep.label for dep_key, dep in dep_tasks_per_unique_key.items() } copy_of_attributes = primary_dep.attributes.copy() - job["attributes"] = { + task["attributes"] = { **copy_of_attributes, - **job["attributes"], + **task["attributes"], **{"kind": kind}, } - job.setdefault("run-on-tasks-for", copy_of_attributes['run_on_tasks_for']) + task.setdefault("run-on-tasks-for", copy_of_attributes["run_on_tasks_for"]) - yield job + yield task def get_primary_dep(config, dep_tasks): diff --git a/taskcluster/xpi_taskgraph/loader/single_dep.py b/taskcluster/xpi_taskgraph/loader/single_dep.py index aef8a74..387a7c6 100644 --- a/taskcluster/xpi_taskgraph/loader/single_dep.py +++ b/taskcluster/xpi_taskgraph/loader/single_dep.py @@ -5,28 +5,27 @@ import copy -from voluptuous import Required - from taskgraph.task import Task from taskgraph.util.schema import Schema +from voluptuous import Required schema = Schema({Required("primary-dependency", "primary dependency task"): Task}) def loader(kind, path, config, params, loaded_tasks): """ - Load tasks based on the jobs dependant kinds. + Load tasks based on the tasks dependant kinds. Optional `only-for-attributes` kind configuration, if specified, will limit - the jobs chosen to ones which have the specified attribute, with the specified + the tasks chosen to ones which have the specified attribute, with the specified value. - Optional `job-template` kind configuration value, if specified, will be used to + Optional `task-template` kind configuration value, if specified, will be used to pass configuration down to the specified transforms used. """ only_attributes = config.get("only-for-attributes") only_addon_types = config.get("only-for-addon-types") - job_template = config.get("job-template") + task_template = config.get("task-template") for task in loaded_tasks: if task.kind not in config.get("kind-dependencies", []): @@ -43,9 +42,9 @@ def loader(kind, path, config, params, loaded_tasks): if not addon_type in only_addon_types: continue - job = {"primary-dependency": task} + task = {"primary-dependency": task} - if job_template: - job.update(copy.deepcopy(job_template)) + if task_template: + task.update(copy.deepcopy(task_template)) - yield job + yield task diff --git a/taskcluster/xpi_taskgraph/transforms/build.py b/taskcluster/xpi_taskgraph/transforms/build.py index 99aba60..afabc25 100644 --- a/taskcluster/xpi_taskgraph/transforms/build.py +++ b/taskcluster/xpi_taskgraph/transforms/build.py @@ -2,34 +2,33 @@ # 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/. """ -Apply some defaults and minor modifications to the jobs defined in the build +Apply some defaults and minor modifications to the tasks defined in the build kind. """ -from copy import deepcopy import os +from copy import deepcopy from taskgraph.transforms.base import TransformSequence from xpi_taskgraph.xpi_manifest import get_manifest - transforms = TransformSequence() @transforms.add -def tasks_from_manifest(config, jobs): +def tasks_from_manifest(config, tasks): manifest = get_manifest() xpi_name = config.params.get("xpi_name") xpi_revision = None if xpi_name: xpi_revision = config.params.get("xpi_revision") - for job in jobs: + for task_raw in tasks: for xpi_config in manifest.values(): if not xpi_config.get("active"): continue if xpi_name and xpi_config["manifest_name"] != xpi_name: continue - task = deepcopy(job) + task = deepcopy(task_raw) env = task.setdefault("worker", {}).setdefault("env", {}) run = task.setdefault("run", {}) checkout = run.setdefault("checkout", {}) diff --git a/taskcluster/xpi_taskgraph/transforms/cached.py b/taskcluster/xpi_taskgraph/transforms/cached.py index b4a3a30..ea7855a 100644 --- a/taskcluster/xpi_taskgraph/transforms/cached.py +++ b/taskcluster/xpi_taskgraph/transforms/cached.py @@ -6,16 +6,12 @@ """ -import hashlib import json import os -import subprocess import taskgraph from taskgraph.transforms.base import TransformSequence from taskgraph.util.hash import hash_path, hash_paths -from taskgraph.util.memoize import memoize - from xpi_taskgraph.xpi_manifest import MANIFEST_DIR transforms = TransformSequence() @@ -82,8 +78,8 @@ def build_cache(config, tasks): @transforms.add -def set_label(config, jobs): - """Set the job label, which the `cached_tasks` transform needs""" - for job in jobs: - job.setdefault("label", "{}-{}".format(config.kind, job.pop("name"))) - yield job +def set_label(config, tasks): + """Set the task label, which the `cached_tasks` transform needs""" + for task in tasks: + task.setdefault("label", "{}-{}".format(config.kind, task.pop("name"))) + yield task diff --git a/taskcluster/xpi_taskgraph/transforms/post_build.py b/taskcluster/xpi_taskgraph/transforms/post_build.py index 9c3f511..31e4b98 100644 --- a/taskcluster/xpi_taskgraph/transforms/post_build.py +++ b/taskcluster/xpi_taskgraph/transforms/post_build.py @@ -2,17 +2,15 @@ # 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/. """ -Apply some defaults and minor modifications to the jobs defined in the build +Apply some defaults and minor modifications to the tasks defined in the build kind. """ -import json import os from taskgraph.transforms.base import TransformSequence from xpi_taskgraph.xpi_manifest import get_manifest - transforms = TransformSequence() diff --git a/taskcluster/xpi_taskgraph/transforms/release_github.py b/taskcluster/xpi_taskgraph/transforms/release_github.py index 46cd68b..f2ccc54 100644 --- a/taskcluster/xpi_taskgraph/transforms/release_github.py +++ b/taskcluster/xpi_taskgraph/transforms/release_github.py @@ -2,17 +2,17 @@ # 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/. """ -Apply some defaults and minor modifications to the jobs defined in the github_release +Apply some defaults and minor modifications to the tasks defined in the github_release kind. """ +import os + from taskgraph.config import load_graph_config from taskgraph.transforms.base import TransformSequence from taskgraph.util.schema import resolve_keyed_by from xpi_taskgraph.xpi_manifest import get_manifest -import os - BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) ROOT = os.path.join(BASE_DIR, "ci") @@ -20,18 +20,18 @@ @transforms.add -def resolve_keys(config, jobs): - for job in jobs: +def resolve_keys(config, tasks): + for task in tasks: for key in ("worker.github-project", "worker.release-name"): resolve_keyed_by( - job, key, item_name=job["name"], **{"level": config.params["level"]} + task, key, item_name=task["name"], **{"level": config.params["level"]} ) - yield job + yield task @transforms.add -def build_worker_definition(config, jobs): - for job in jobs: +def build_worker_definition(config, tasks): + for task in tasks: if not ( config.params.get("version") and config.params.get("xpi_name") @@ -40,7 +40,7 @@ def build_worker_definition(config, jobs): continue resolve_keyed_by( - job, "scopes", item_name=job["name"], **{"level": config.params["level"]} + task, "scopes", item_name=task["name"], **{"level": config.params["level"]} ) # translate input xpi_name to get manifest and graph info @@ -62,7 +62,7 @@ def build_worker_definition(config, jobs): continue worker_definition = { - "artifact-map": _build_artifact_map(job), + "artifact-map": _build_artifact_map(task), "git-tag": config.params["head_tag"], "git-revision": config.params["xpi_revision"], "github-project": repo, @@ -74,16 +74,16 @@ def build_worker_definition(config, jobs): "version": config.params["version"], "build_number": config.params["build_number"], } - tag_name = manifest_config.get("release-tag", "{version}-build{build_number}").format( - **release_variables - ) + tag_name = manifest_config.get( + "release-tag", "{version}-build{build_number}" + ).format(**release_variables) worker_definition["git-tag"] = tag_name release_name = manifest_config.get( "release-name", "{xpi_name}-{version}-build{build_number}" ).format(**release_variables) - job["worker"]["release-name"] = release_name + task["worker"]["release-name"] = release_name - dep = job["primary-dependency"] + dep = task["primary-dependency"] worker_definition["upstream-artifacts"] = [ { "taskId": {"task-reference": ""}, @@ -98,22 +98,22 @@ def build_worker_definition(config, jobs): and "ARTIFACT_PREFIX" in dep.task["payload"]["env"] ): if not dep.task["payload"]["env"]["ARTIFACT_PREFIX"].startswith("public"): - scopes = job.setdefault("scopes", []) + scopes = task.setdefault("scopes", []) scopes.append( "queue:get-artifact:{}/*".format( dep.task["payload"]["env"]["ARTIFACT_PREFIX"].rstrip("/") ) ) - job["worker"].update(worker_definition) - job["dependencies"] = {"release-signing": dep.label} - del job["primary-dependency"] - yield job + task["worker"].update(worker_definition) + task["dependencies"] = {"release-signing": dep.label} + del task["primary-dependency"] + yield task -def _build_artifact_map(job): +def _build_artifact_map(task): artifact_map = [] - dep = job["primary-dependency"] + dep = task["primary-dependency"] artifacts = {"paths": {}, "taskId": {"task-reference": ""}} for path in dep.attributes["xpis"].values(): diff --git a/taskcluster/xpi_taskgraph/transforms/release_mark_as_shipped.py b/taskcluster/xpi_taskgraph/transforms/release_mark_as_shipped.py index ea1e542..4a78986 100644 --- a/taskcluster/xpi_taskgraph/transforms/release_mark_as_shipped.py +++ b/taskcluster/xpi_taskgraph/transforms/release_mark_as_shipped.py @@ -10,24 +10,24 @@ @transforms.add -def make_task_description(config, jobs): - for job in jobs: +def make_task_description(config, tasks): + for task in tasks: if not ( config.params.get("version") and config.params.get("xpi_name") and config.params.get("build_number") ): continue - if "primary-dependency" in job: - job.pop("primary-dependency") + if "primary-dependency" in task: + task.pop("primary-dependency") resolve_keyed_by( - job, "scopes", item_name=job["name"], **{"level": config.params["level"]} + task, "scopes", item_name=task["name"], **{"level": config.params["level"]} ) - job["worker"][ + task["worker"][ "release-name" ] = "{xpi_name}-{version}-build{build_number}".format( xpi_name=config.params["xpi_name"], version=config.params["version"], build_number=config.params["build_number"], ) - yield job + yield task diff --git a/taskcluster/xpi_taskgraph/transforms/release_notifications.py b/taskcluster/xpi_taskgraph/transforms/release_notifications.py index 8c774cc..c9ee123 100644 --- a/taskcluster/xpi_taskgraph/transforms/release_notifications.py +++ b/taskcluster/xpi_taskgraph/transforms/release_notifications.py @@ -8,16 +8,13 @@ from taskgraph.transforms.base import TransformSequence from taskgraph.util.keyed_by import evaluate_keyed_by -from taskgraph.util.schema import resolve_keyed_by - from xpi_taskgraph.xpi_manifest import get_manifest - transforms = TransformSequence() @transforms.add -def add_notifications(config, jobs): +def add_notifications(config, tasks): xpi_name = config.params.get("xpi_name") xpi_revision = config.params.get("xpi_revision") shipping_phase = config.params.get("shipping_phase") @@ -27,19 +24,19 @@ def add_notifications(config, jobs): return manifest = get_manifest() - for job in jobs: - if "primary-dependency" in job: - dep = job.pop("primary-dependency") + for task in tasks: + if "primary-dependency" in task: + dep = task.pop("primary-dependency") if dep.task.get("extra", {}).get("xpi-name") != xpi_name: continue attributes = dep.attributes.copy() - if job.get("attributes"): - attributes.update(job["attributes"]) - job["attributes"] = attributes - job.setdefault("dependencies", {}).update({"signing": dep.label}) - if job.get("attributes", {}).get("shipping-phase") != shipping_phase: + if task.get("attributes"): + attributes.update(task["attributes"]) + task["attributes"] = attributes + task.setdefault("dependencies", {}).update({"signing": dep.label}) + if task.get("attributes", {}).get("shipping-phase") != shipping_phase: continue - job["label"] = f"{config.kind}-{shipping_phase}" + task["label"] = f"{config.kind}-{shipping_phase}" xpi_config = manifest[xpi_name] xpi_type = xpi_config["addon-type"] @@ -54,20 +51,20 @@ def add_notifications(config, jobs): emails + additional_shipit_emails + xpi_config.get("additional-emails", []) ) notifications = evaluate_keyed_by( - job.pop("notifications"), "notification config", dict(phase=shipping_phase) + task.pop("notifications"), "notification config", dict(phase=shipping_phase) ) format_kwargs = dict(config=config.__dict__) subject = notifications["subject"].format(**format_kwargs) message = notifications["message"].format(**format_kwargs) # We only send mail on success to avoid messages like 'blah is in the - # candidates dir' when cancelling graphs, dummy job failure, etc - job.setdefault("routes", []).extend( + # candidates dir' when cancelling graphs, dummy task failure, etc + task.setdefault("routes", []).extend( [f"notify.email.{email}.on-completed" for email in emails] ) - job.setdefault("extra", {}).update({"notify": {"email": {"subject": subject}}}) + task.setdefault("extra", {}).update({"notify": {"email": {"subject": subject}}}) if message: - job["extra"]["notify"]["email"]["content"] = message + task["extra"]["notify"]["email"]["content"] = message - yield job + yield task diff --git a/taskcluster/xpi_taskgraph/transforms/signing.py b/taskcluster/xpi_taskgraph/transforms/signing.py index 45a048a..255f66e 100644 --- a/taskcluster/xpi_taskgraph/transforms/signing.py +++ b/taskcluster/xpi_taskgraph/transforms/signing.py @@ -2,15 +2,14 @@ # 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/. """ -Apply some defaults and minor modifications to the jobs defined in the build +Apply some defaults and minor modifications to the tasks defined in the build kind. """ from taskgraph.transforms.base import TransformSequence -from taskgraph.util.schema import resolve_keyed_by from taskgraph.util.keyed_by import evaluate_keyed_by - +from taskgraph.util.schema import resolve_keyed_by transforms = TransformSequence() @@ -35,7 +34,7 @@ def define_signing_flags(config, tasks): for task in tasks: dep = task["primary-dependency"] # Current kind will be prepended later in the transform chain. - task["name"] = _get_dependent_job_name_without_its_kind(dep) + task["name"] = _get_dependent_task_name_without_its_kind(dep) attributes = dep.attributes.copy() if task.get("attributes"): attributes.update(task["attributes"]) @@ -90,5 +89,5 @@ def build_signing_task(config, tasks): yield task -def _get_dependent_job_name_without_its_kind(dependent_job): - return dependent_job.label[len(dependent_job.kind) + 1 :] +def _get_dependent_task_name_without_its_kind(dependent_task): + return dependent_task.label[len(dependent_task.kind) + 1 :]