beetmover_source.py (1423B)
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 beetmover-source task to also append `build` as dependency 6 """ 7 8 from taskgraph.transforms.base import TransformSequence 9 10 transforms = TransformSequence() 11 12 13 @transforms.add 14 def remove_build_dependency_in_beetmover_source(config, jobs): 15 for job in jobs: 16 # XXX: We delete the build dependency because, unlike the other beetmover 17 # tasks, source doesn't depend on any build task at all. This hack should 18 # go away when we rewrite beetmover transforms to allow more flexibility in deps 19 # Essentially, we should use multi_dep for beetmover. 20 for depname in job["dependencies"]: 21 if "signing" not in depname: 22 del job["dependencies"][depname] 23 break 24 else: 25 raise Exception("Can't find build dep in beetmover source!") 26 27 all_upstream_artifacts = job["worker"]["upstream-artifacts"] 28 upstream_artifacts_without_build = [ 29 upstream_artifact 30 for upstream_artifact in all_upstream_artifacts 31 if upstream_artifact["taskId"]["task-reference"] != f"<{depname}>" 32 ] 33 job["worker"]["upstream-artifacts"] = upstream_artifacts_without_build 34 35 yield job