Skip to content

Resolve PR/MR base from remote branches - #13

Merged
simo5 merged 1 commit into
mainfrom
review_fix
Oct 28, 2026
Merged

simo5 merged 1 commit into
mainfrom
review_fix

Conversation

@simo5

@simo5 simo5 commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Refresh the selected remote before review and rank its remote-tracking branches by the number of commits between each merge-base and the PR/MR head. Use the branch with the fewest such commits, with the default branch breaking ties, so reviews of PRs/MRs targeting non-default branches no longer include unrelated commits. Warn and fall back to reviewing only the tip when no base can be determined, document the behavior, and add unit and end-to-end regression tests.

Assisted-by: rits/deepseek-ai/DeepSeek-V4.1-Flash-1017

Refresh remote-tracking branches before resolving a PR/MR review range
and determine the target branch by finding the remote branch with the
fewest diverging commits. This ensures stale local clones do not pull in
unrelated upstream commits and properly supports PRs/MRs targeting
non-default branches without querying external APIs. Additionally, abort
the review early if the PR/MR is empty or already merged.

Assisted-by: rits/deepseek-ai/DeepSeek-V4.1-Flash-1017
Assisted-by: Gemini 4 Argon
Signed-off-by: Simo Sorce <simo@redhat.com>
@simo5
simo5 merged commit 46566d6 into main Oct 28, 2026
1 check passed
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.

1 participant