Skip to content

Park only the pull requests a reorder actually endangers - #368

Merged
ezyang merged 1 commit into
mainfrom
park-only-endangered
Sep 24, 2026
Merged

ezyang merged 1 commit into
mainfrom
park-only-endangered

Conversation

@ezyang

@ezyang ezyang commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Follow-up to #367 / a7a5bba, cherry-picked as-is from @smeenai's smeenai@f7c60ba (author preserved).

a7a5bba parked every direct-mode pull request whose base ref changed on the default branch before pushing. That also caught pull requests that were never at risk (e.g. a commit inserted below them), costing an API call and two base-change timeline entries each, as @slinder1 noticed. This decides by reachability instead: a pull request is parked only if its new head is an ancestor of the commit its old base is about to point at, which is known locally before pushing.

github_fake now counts base changes; the new insert_middle_base_churn test fails in direct mode without the fix.

🤖 Generated with Claude Code

Parking every pull request whose base ref changed also catches ones that
were never at risk, such as when a commit is inserted below them: their
base moves onto a different pull request, but nothing becomes reachable
from the base they had.  Each of those costs an API call and two
base-change entries in the pull request's timeline.

Decide by reachability instead, against the commit each old base is about
to point at, which is known locally before anything is pushed.

github_fake counts base changes so a test can pin this down.
@ezyang
ezyang merged commit 68d401f into main Sep 24, 2026
16 checks passed
@ezyang
ezyang deleted the park-only-endangered branch September 24, 2026 17:24
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