Skip to content

[luv-68] fix: require-pr-before-stop skips when no changes vs base branch#67

Merged
NiveditJain merged 1 commit into
mainfrom
luv-68
Apr 9, 2026
Merged

[luv-68] fix: require-pr-before-stop skips when no changes vs base branch#67
NiveditJain merged 1 commit into
mainfrom
luv-68

Conversation

@NiveditJain
Copy link
Copy Markdown
Member

Summary

  • Fixed require-pr-before-stop policy incorrectly firing when a PR was already merged and no new changes existed on the branch
  • Added early-exit checks: git log for commit ancestry (handles regular merges) + git diff --stat fallback (handles squash merges)
  • Added configurable baseBranch param (default: "main") so users can compare against a different base branch

Test plan

  • All 830 unit tests pass (bun run test:run)
  • Build succeeds (bun run build)
  • CI green on all 4 jobs (quality, test, build, test-e2e)
  • Verify: on a branch with merged PR, policy allows stop
  • Verify: on a branch with unmerged changes, policy denies as before

🤖 Generated with Claude Code

…anch

The policy was incorrectly denying stop when a PR was merged but no new
changes existed on the branch. Now checks git log + git diff against
origin/{baseBranch} before requiring a PR. Handles both regular and
squash merges. Adds configurable baseBranch param (default: "main").

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 9, 2026

Warning

Rate limit exceeded

@NiveditJain has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 23 minutes and 19 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 23 minutes and 19 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 613c4614-95a3-471b-8bd5-2d3705f9532c

📥 Commits

Reviewing files that changed from the base of the PR and between 544daf1 and 5f22098.

📒 Files selected for processing (2)
  • __tests__/hooks/builtin-policies.test.ts
  • src/hooks/builtin-policies.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch luv-68

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@NiveditJain NiveditJain merged commit 4091aa8 into main Apr 9, 2026
8 checks passed
@NiveditJain NiveditJain deleted the luv-68 branch April 21, 2026 01:31
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