Build PRs targeting main, recognized GitHub Stacks, or other tracked open PRs - #361
Merged
Conversation
…open PRs Previously the scheduler only built PRs whose base branch was literally "main", so a PR whose base is another PR's branch (a stacked PR, e.g. halide/Halide#9253 based on #9251) was silently never scheduled. Move the gating into SafeGitHubEventHandler.handle_pull_request, where the full PR payload is available: - base == "main": build, as before. - base is a release/N.x branch: skip, as before. - PR is part of a recognized GitHub Stack (the `stack` payload field): build. refs/pull/<N>/merge for a stacked PR is chained through every lower PR's own merge ref, so building it already transitively tests against stack.base.ref (main) -- confirmed by inspecting the actual merge commit parents on halide/Halide#9249-#9253. - base is otherwise the head of another open PR in the same repo (an informal/pre-Stacks-feature chain): build. - anything else (an untracked, possibly short-lived branch): skip, to avoid wasting CI on builds that can be invalidated without warning. Fixes #148 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
main, so a PR whose base is another PR's branch (a stacked PR, e.g. [Target] Keep all implied features in canonical representation Halide#9253 based on #9251) was silently never scheduled.SafeGitHubEventHandler.handle_pull_request, where the full PR payload is available. A PR is now built if:main(unchanged), orstackpayload field) — confirmed by inspecting the actualrefs/pull/*/mergecommit parents on [Target] Replace public fields with getters/setters Halide#9249-#9253 that this ref is chained through every lower PR's own merge ref, so building it already transitively tests againststack.base.ref(main), orrelease/N.xbranches are still skipped (unchanged), and anything else (an untracked, possibly short-lived branch) is now explicitly skipped to avoid wasting CI on builds that can be invalidated without warning.Fixes #148
Test plan
ruff check,ty checkpass (also verified via pre-commit hooks on commit)🤖 Generated with Claude Code