Closed Bug 1759030 Opened 3 years ago Closed 2 years ago

Merge generator.py between the two taskgraphs

Categories

(Firefox Build System :: Task Configuration, task)

task

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ahal, Assigned: ahal)

References

(Blocks 1 open bug)

Details

Attachments

(6 files, 7 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
251.98 KB, patch
Details | Diff | Splinter Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
No description provided.
Assignee: nobody → ahal
Keywords: leave-open
Status: NEW → ASSIGNED

While a dict is a better data structure to hold this information (as we can do
quick containment checks), the standalone version uses a list. If we decided to
switch over to a dict there instead, we'd be introducing a new backwards
incompatible change and need to make a new major version of Taskgraph.

So for now it's best to make 'gecko_taskgraph' follow standalone's convention.

Currently all verifications loop over tasks in a taskgraph. Though there are
some miscellaneous verifications in generator.py for things like parameters and
attributes. These verifications are currently specific to Gecko and cannot be
ported to other repositories.

This patch refactors the verifications logic to enable adding other arbitrary
verifications that don't use the same parameter values that a normal task
verification does. This will allow us to move the Gecko specific verifications
out of 'generator.py', which will allow us to use the standalone taskgraph
version of it.

Depends on D142022

Standalone taskgraph doesn't have a 'verify_parameters' function as we can't
assume that parameters are documented in every consumer repo. By moving these
to proper verifications in util/verify.py, each consumer repo in standalone may
optional implement something for them or not (as they see fit).

Depends on D142023

Comment on attachment 9269330 [details]
Bug 1759030 - Refactor util/verify.py to support non-task verifications, r?#releng-reviewers!

Revision D142023 was moved to bug 1748929. Setting attachment 9269330 [details] to obsolete.

Attachment #9269330 - Attachment is obsolete: true

Comment on attachment 9269331 [details]
Bug 1759030 - Move TaskGraphGenerator.verify_* to a verifications in util/verify.py, r?#releng-reviewers!

Revision D142024 was moved to bug 1748929. Setting attachment 9269331 [details] to obsolete.

Attachment #9269331 - Attachment is obsolete: true
Attachment #9269329 - Attachment is obsolete: true
Depends on: 1766316
Depends on: 1776431
Depends on: 1780273
Depends on: 1780278

Comment on attachment 9286112 [details]
Bug 1759030 - Use target_task method registration from standalone taskgraph, r?#taskgraph-reviewers

Revision D152211 was moved to bug 1780273. Setting attachment 9286112 [details] to obsolete.

Attachment #9286112 - Attachment is obsolete: true

Comment on attachment 9286113 [details]
Bug 1759030 - Use 'filter_tasks' from standalone taskgraph, r?#taskgraph-reviewers

Revision D152212 was moved to bug 1780273. Setting attachment 9286113 [details] to obsolete.

Attachment #9286113 - Attachment is obsolete: true

This function is called by generator.py, so we need to replace this before we
can replace that.

Attachment #9293517 - Attachment description: WIP: Bug 1759030 - Use 'taskgraph.register_morph' in gecko_taskgraph → Bug 1759030 - Use 'taskgraph.register_morph' in gecko_taskgraph, r?#releng-reviewers
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0c04847a9e46 Use 'load_graph_config' from vendored taskgraph, r=releng-reviewers,jlorenzo
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9695f66aa0fe Use 'taskgraph.register_morph' in gecko_taskgraph, r=releng-reviewers,gbrown

The always_target attribute is a feature which I believe I previously
mis-implemented. It doesn't belong in generator.py and should instead be
implemented somewhere in target_tasks.py. I chose to wrap the registration
decorator to guarantee backwards compatibility within Gecko. Though we may wish
to move it out to a filter in the future.

I'm making this change now to facilitate merging standalone and Gecko
taskgraphs. The always_target feature will be removed from standalone (as it
isn't being used and should consumers need something like it, they can roll
their own implementations).

With the feature removed from both Gecko and standalone in generator.py, this
file will now be identical across both Taskgraphs and can therefore be removed
from Gecko.

Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b7380df3b9a8 [gecko_taskgraph] Move 'always_target' implementation outside of generator.py, r=releng-reviewers,gbrown
See Also: → 1795488
Regressions: 1795921
Duplicate of this bug: 1603184
Attachment #9298234 - Attachment is obsolete: true

Patch to vendor taskcluster-taskgraph at 3.5.0 as requested by :ahal.

Patch to vendor taskcluster-taskgraph at 3.5.1 as requested by :ahal.

Attachment #9301210 - Attachment is obsolete: true
Attachment #9301589 - Attachment description: WIP: Bug 1759030 - Vendor `taskcluster-taskgraph` at `3.5.1` → Bug 1759030 - Vendor `taskcluster-taskgraph` at `3.5.1`
Attachment #9301589 - Attachment description: Bug 1759030 - Vendor `taskcluster-taskgraph` at `3.5.1` → Bug 1759030 - Vendor `taskcluster-taskgraph` at `3.5.1`, r?ahochheiden!

This is the last place that in gecko_taskgraph/generator.py that calls into
gecko_taskgraph code. By removing it, the two generator.py files will be
identical and the gecko_taskgraph copy can be removed.

Depends on D161056

Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3f2b2e009c00 Vendor `taskcluster-taskgraph` at `3.5.1`, r=ahochheiden https://hg.mozilla.org/integration/autoland/rev/9940b1cf6881 Use 'verifications' from upstream taskgraph module, r=releng-reviewers,gbrown https://hg.mozilla.org/integration/autoland/rev/9c52daf6117c [gecko_taskgraph] Use 'generator.py' from upstream Taskgraph, r=releng-reviewers,jlorenzo
Regressions: 1799074

Backed out for causing for causing Bug 1799074.

Flags: needinfo?(ahal)
Backout by sstanca@mozilla.com: https://hg.mozilla.org/mozilla-central/rev/d5fdedfaefcb Backed out 3 changesets for causing Bug 1799074. CLOSED TREE

The problem was simply because we were validating against taskgraph.config.graph_config_schema instead of gecko_taskgraph.config.graph_config_schema. This got regressed in this patch due to changing:

- from gecko_taskgraph.generator import load_tasks_for_kind
+ from taskgraph.generator import load_tasks_for_kind

in python/mozbuild/mozbuild/toolchains.py.

Previously the gecko_taskgraph import was triggering this line which made everything work. Now, that import was no longer happening. A simple (somewhat hacky) fix is to add an unused import gecko_taskgraph directly prior.

I have ideas around better support for extending Taskgraph so we don't need to do all this hacky monkeypatching in gecko_taskgraph. But that is a larger project which likely won't be prioritized for awhile, so for now I think the simple fix is the way to go.

Flags: needinfo?(ahal)
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/965dd7af8b21 Vendor `taskcluster-taskgraph` at `3.5.1`, r=ahochheiden https://hg.mozilla.org/integration/autoland/rev/952c83a44302 Use 'verifications' from upstream taskgraph module, r=releng-reviewers,gbrown https://hg.mozilla.org/integration/autoland/rev/b9c288fda96d [gecko_taskgraph] Use 'generator.py' from upstream Taskgraph, r=releng-reviewers,jlorenzo
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: