Skip to content

Bug 2050679 - feat: add copy_attributes_from_dependent_job utility#222

Open
kryoseu wants to merge 1 commit into
mozilla-releng:mainfrom
kryoseu:feat-copy-attributes
Open

Bug 2050679 - feat: add copy_attributes_from_dependent_job utility#222
kryoseu wants to merge 1 commit into
mozilla-releng:mainfrom
kryoseu:feat-copy-attributes

Conversation

@kryoseu

@kryoseu kryoseu commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

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.

Why only copy_attributes_from_dependent_job?

gecko_taskgraph.util.attributes has several functions, but IMO they don't all belong here. mozilla-taskgraph is for logic that's generic across Mozilla projects and actually shared between them. This function fits: both gecko and comm use 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_projects function 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 upstream Taskgraph instead? 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.

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.
@kryoseu kryoseu requested a review from a team as a code owner June 25, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant