Refactor builder setup#736
Open
encukou wants to merge 2 commits into
Open
Conversation
Builders were set up as lists of triples, which is somewhat cumbersome (especially when changing the tier/stability, which means moving the definition around). Instead, add a new dataclass, `BuilderDef`, which holds the data. Convert a single definition to the "new" format, to avoid conflicts while this PR is in flight. Turn `stability` and `tier` into generic flags, stored in a frozenset. This way, more can be added later, when it makes more sense here than on the worker. Add attributes/helpers to get the stability & tier back from the tags. Print out a formatted list of builders when the module is run as a tool (`python -m custom.builders`).
zware
approved these changes
Jun 11, 2026
| ), | ||
| ] | ||
|
|
||
| def generate_builderefs(tags, tuples): |
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.
Time for the big one!
Builders were defined as lists of triples, which is somewhat cumbersome (especially when changing the tier/stability, which means moving the definition around).
Instead, add a new dataclass,
BuilderDef, which holds the data.Convert a single definition to the "new" format. Use an adapter for the others, to avoid conflicts while this PR is in flight (and perhaps later -- there's not much need to convert, until a definition needs some new feature).
Turn
stabilityandtierinto generic flags, stored in a frozenset. This way, more tags can be added later, when it makes more sense here than on the worker.Add attributes/helpers to get the stability & tier back from the tags.
Print out a formatted list of builders when the module is run as a tool (
python -m custom.builders).Worker selection is moved to (two lines in)
master.cfg; I intend to work on that in the future.The "new style" uses
factories.xxxBuildinstead of having to import each factory class individually.I'm filing PRs with individual changes from @zware's branch, to review/test/fixup/revert the changes one by one. This is based on 5f8ac35.
Unlike that commit, this does not prepare for multiple worker support (and worker selection by tags). I'm not forgetting that, just not doing it here :)