Skip to content

Use a (smart) set of branches for branch selection#752

Open
encukou wants to merge 2 commits into
python:mainfrom
encukou:builder-branch-selection-s
Open

Use a (smart) set of branches for branch selection#752
encukou wants to merge 2 commits into
python:mainfrom
encukou:builder-branch-selection-s

Conversation

@encukou

@encukou encukou commented Jul 2, 2026

Copy link
Copy Markdown
Member

Add a branches attribute on worker, builderdef & buildfactory objects. This is a set(-like) of branches the object applies to.
The set of all branches is exposed as branches.BRANCHES, in a custom object with some convenience APIs.

This replaced several ways of filtering which branches apply to a given build:

  • builders.ONLY_MAIN_BRANCH -- a set of name fragments; builds with matching names are limited to the main & PR branch
  • worker branches & not_branches lists: these were usually for testing a feature introduced in 3.X, or made obsolete in 3.X. I tried several variants before settling on only_since & only_until.
  • wasm_tier & the wasm tag. This PR happened to bring the WASM skipping logic to one place, with comments talking about specific versions. So I removed the wasm_tier attribute on BranchInfo objects.

Let me know if this seems like a good direction.


I made the generate_builderdefs function from #736 take BuilderDef objects in addition to tuples. Avoiding unrelated moves makes for simpler diffs.


I'm filing PRs with individual changes from @zware's branch, to review/test/fixup/revert the changes one by one. This is based -- very loosely this time -- on 82eb39d.

@encukou encukou requested a review from zware July 2, 2026 13:00

@zware zware left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

Comment thread master/custom/branches.py
yield _maintenance_branch(3, 13)
yield _maintenance_branch(3, 12)
yield _maintenance_branch(3, 11)
yield _maintenance_branch(3, 10)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Sidenote, not for this PR): I wonder if we could get away with pulling the canonical branch info file and generating branches from it. Or maybe rather than pulling it on startup, use Salt to pull on a schedule and stash it in a known location, and trigger a restart on changes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but given the current/near-future state of things I think it's better as an intentional change involving a checkconfig.

We'd want to combine it with a clean-up PR anyway.

host_configure_cmd = ["../../Tools/wasm/wasi-env", "../../configure"]

# See comment in _Wasm32WasiPreview1Build.__init__
branches = {BRANCHES[3, 11], BRANCHES[3, 12]}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will blow up on us when 3.11 goes away, but CI should catch it. I'm not sure we should change anything for that fact, but it is something for us to be aware of.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also spell this .only_since(3, 11).only_until(3, 12), which doesn't have this problem. But I wanted to leave another example of how to pick individual branches.

Comment thread master/custom/factories.py Outdated
Comment thread master/custom/workers.py
method="clobber",
shallow=True,
# Disable the default, if set
filters=None,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I hadn't yet realized my PR was merged; I was going to update it to something very close to what you had suggested, but hadn't made it back to it yet :)

Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
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.

2 participants