resolve_landoscript_keyed_by.py (1499B)
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 update generation task into an actual task description. 6 """ 7 8 from taskgraph.transforms.base import TransformSequence 9 from taskgraph.util.schema import resolve_keyed_by 10 11 transforms = TransformSequence() 12 13 14 @transforms.add 15 def handle_keyed_by(config, tasks): 16 """Resolve fields that can be keyed by platform, etc.""" 17 default_fields = [ 18 "scopes", 19 "worker.push", 20 "worker.bump-files", 21 "worker-type", 22 "worker.actions[].tag.hg-repo-url", 23 "worker.actions[].version-bump.bump-files", 24 ] 25 for task in tasks: 26 fields = default_fields[:] 27 for additional_field in ( 28 "actions", 29 "l10n-bump-info", 30 "source-repo", 31 "lando-repo", 32 "hg-repo-url", 33 "dontbuild", 34 "ignore-closed-tree", 35 ): 36 if additional_field in task["worker"]: 37 fields.append(f"worker.{additional_field}") 38 for field in fields: 39 resolve_keyed_by( 40 task, 41 field, 42 item_name=task["name"], 43 **{ 44 "project": config.params["project"], 45 "release-type": config.params["release_type"], 46 }, 47 ) 48 49 yield task