Repository navigation
fix: stop the score action from clobbering the base ref - #87
Merged
2 commits merged intoSep 27, 2026
Merged
2 commits merged into
2 commits merged into
Conversation
score_pr.py materialised the PR's base and head as local branches named after them. A fork PR opened from the fork's own 'main' has HEAD_BRANCH == BASE_BRANCH, so the second 'git branch -f' pointed the base at the PR head, the diff came out empty, and the PR was reported as within limits. Pass origin/<base> and the fetched head ref straight to pr-split instead; rev-parse --verify accepts any ref.
|
Warning Review limit reachedNext included review available in 45 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Main's split now requires --base to be a local branch, so keep creating the local base branch from origin/<base> and only stop materialising the head: pass the fetched head ref (pr-split/head-<n> or origin/<head>) directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015rnEEjXWDBdePRhKMmZr1w
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.
Problem
scripts/score_pr.pyturned the PR's base and head into local branches named after them:A fork PR opened from the fork's own
main(very common) hasHEAD_BRANCH == BASE_BRANCH == main, so the second command re-pointedmainat the PR head.git diff main...mainis empty,pr-split splitproduced a 0-group plan, and the PR was reported as within limits. Verified in a scratch clone with a realrefs/pull/7/head: the old script leftmain == pr-split/head-7 != origin/main.Fix
Don't materialise branches at all. Pass
origin/<base>and the fetched head ref (pr-split/head-<n>, ororigin/<head>when there is no PR number) straight topr-split split;branch_existsusesrev-parse --verify, andextract_diff/merge_baseaccept any ref (verified end to end: 6 groups on a 240-LOC PR).Tests
git branchcalls,splitinvoked withpr-split/head-7 --base origin/mainorigin/feature --base origin/mainBoth fail on base. Local review: 5/5. 446 tests pass, ruff clean.
Note: the action still reports 0 groups until #53 (plan-file key) merges; the two fixes are independent.