Park only the pull requests a reorder actually endangers - #368
Merged
Merged
Conversation
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.
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.
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_churntest fails in direct mode without the fix.🤖 Generated with Claude Code