Bug 2050679 - feat: add copy_attributes_from_dependent_job utility#222
Open
kryoseu wants to merge 1 commit into
Open
Bug 2050679 - feat: add copy_attributes_from_dependent_job utility#222kryoseu wants to merge 1 commit into
kryoseu wants to merge 1 commit into
Conversation
Add copy_attributes_from_dependent_job and its `_COPYABLE_ATTRIBUTES` allowlist, which inherit a curated set of release/build attributes from a dependent job. Only attributes present on the dependent job and not in the caller-supplied denylist are copied, so entries that don't apply to a given job are skipped. This logic currently lives in gecko_taskgraph; moving it here lets gecko and comm share a single implementation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add copy_attributes_from_dependent_job and its
_COPYABLE_ATTRIBUTESallowlist, which inherit a curated set of release/build attributes from a dependent job. Only attributes present on the dependent job and not in the caller-supplied denylist are copied, so entries that don't apply to a given job are skipped.This logic currently lives in gecko_taskgraph; moving it here lets gecko and comm share a single implementation.
Why only copy_attributes_from_dependent_job?
gecko_taskgraph.util.attributeshas several functions, but IMO they don't all belong here.mozilla-taskgraphis for logic that's generic across Mozilla projects and actually shared between them. This function fits: bothgeckoandcommuse it, so a single shared implementation makes sense.The rest are intentionally left out:
Project-specific data — I think the project lists, release branches, run-on-project aliases and
match_run_on_projectsfunction are Firefox/Thunderbird-specific, so they stay in each project's own taskgraph, not a shared package. Let me know if you agree on this.Fully generic helpers (
task_name,match_run_on_hg_branches) — since these don't seem to be Mozilla-specific at all, should we move them to upstreamTaskgraphinstead? It appears that taskgraph attributes.py has a sibling match_run_on_git_branches already.Already upstream / unused — a couple (
match_run_on_repo_type,sorted_unique_list) are already thin wrappers around upstream code or have no callers, so they're cleanup in gecko rather than something to move.