Open Bug 2071320 Opened 2 months ago Updated 1 month ago

Deduplicate add_dependencies in transforms/code_review.py between gecko_taskgraph and taskgraph

Categories

(Firefox Build System :: Task Configuration, task)

task

Tracking

(Not tracked)

People

(Reporter: ahal, Unassigned, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug, Whiteboard: [lang=python])

Filing as a good first bug to learn workflows.

gecko_taskgraph/transforms/code_review.py has an add_dependencies transform
that is identical (aside from a job/task variable rename) to
taskgraph.transforms.code_review.add_dependencies in the standalone taskgraph
package.

gecko_taskgraph already depends on the standalone package as a real pip
dependency (taskcluster-taskgraph, pinned in taskcluster/requirements.in),
not a vendored copy. Delete add_dependencies from gecko_taskgraph's
transforms/code_review.py and add the upstream transform
(taskgraph.transforms.code_review.transforms) to gecko_taskgraph's own
TransformSequence instead of reimplementing it. Keep gecko's other two
transforms in this file (add_phabricator_config, add_github_config), which
are Mozilla-specific and have no upstream equivalent.

Link to the code:
https://searchfox.org/firefox-main/rev/88fa72d2f463129e64c2eb5c5227ef20b5c08574/taskcluster/gecko_taskgraph/transforms/code_review.py#14

To verify the fix:

./mach taskgraph full --target-kind code-review

This is part of the ongoing effort tracked in Bug 1742026 to merge
gecko_taskgraph and the standalone taskgraph package, reducing the
maintenance burden of keeping duplicated logic in sync between the two.

Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/contributing/stack_quickref.html

Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.

Hi :ahal, I’m looking into this bug and noticed a difference between Gecko’s add_dependencies and the pinned upstream version.

Gecko reads upstream-attribute from taskcluster/kinds/code-review/kind.yml: code-review-issues uses code-review, while code-review-build-test-issues uses code-review-build-test. Upstream hardcodes code-review, so a direct replacement would change the dependencies of the build/test task.

Would you recommend adding support for upstream-attribute upstream, with code-review as the default, before reusing the transform in Gecko?

You need to log in before you can comment on or make changes to this bug.