Skip to content

fix: prevent bot reviews from blocking /merge-pr#263

Merged
bd73-com merged 4 commits intomainfrom
claude/fix-process-blockers-mC3Ov
Mar 25, 2026
Merged

fix: prevent bot reviews from blocking /merge-pr#263
bd73-com merged 4 commits intomainfrom
claude/fix-process-blockers-mC3Ov

Conversation

@bd73-com
Copy link
Owner

@bd73-com bd73-com commented Mar 24, 2026

Summary

  • Add fallback --admin merge path when bot review dismissal fails (step 7 in merge-pr skill)
  • Update CHANGES_REQUESTED failure handler to distinguish bot vs human reviewers
  • Disable CodeRabbit request_changes_workflow so it leaves comments instead of requesting changes, preventing it from blocking merges

Test plan

  • Run /merge-pr on a PR with a stale CodeRabbit review — verify it attempts dismissal, then falls back to --admin merge
  • Run /merge-pr on a PR with a human CHANGES_REQUESTED review — verify it lists comments and asks user to address them
  • Verify CodeRabbit no longer submits CHANGES_REQUESTED reviews on new PRs

https://claude.ai/code/session_01CCLF7f32dWYYE1UXRL3S46

Summary by CodeRabbit

  • Bug Fixes

    • Bot review dismissal failures no longer abort the merge flow; they now follow a fallback path with additional pre-checks.
  • New Features

    • Re-checks all pre-flight conditions on dismissal failure before recovery.
    • Adds an admin-only fallback merge when only automated reviews block merging; otherwise instructs manual dismissal and retry.
    • Distinguishes bot vs. human change requests and provides tailored guidance.
  • Chores

    • Updated automated review workflow configuration.

- Add fallback --admin merge when bot review dismissal fails
- Distinguish bot vs human reviewers in CHANGES_REQUESTED handler
- Disable CodeRabbit request_changes_workflow to prevent blocking

https://claude.ai/code/session_01CCLF7f32dWYYE1UXRL3S46
@github-actions github-actions bot added the fix label Mar 24, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 24, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8cc0a8ca-7510-487d-b4c8-8ea776be38bc

📥 Commits

Reviewing files that changed from the base of the PR and between f53f080 and e923cfc.

📒 Files selected for processing (1)
  • .claude/commands/merge-pr.md

📝 Walkthrough

Walkthrough

Adds fallback admin-merge and refined bot-vs-human CHANGES_REQUESTED handling to the /merge-pr flow: on automatic dismissal failure the command re-checks pre-flight, classifies reviews into trusted-bot vs human, and will retry a merge with --admin only when blockers are bot-only. Also flips reviews.request_changes_workflow to false in .coderabbit.yaml. Note: this introduces an admin-bypass path applicable when only trusted bots requested changes.

Changes

Cohort / File(s) Summary
Merge PR Command Logic
​.claude/commands/merge-pr.md
Removed immediate exit on trusted-bot dismissal failure; added re-fetch of PR state, re-validation of step-2 pre-flight checks, classification of reviews into bot vs human using the trusted-bot allowlist, --admin retry when only trusted bots requested changes, and new instructions for manual dismissal if --admin fails.
CodeRabbit Review Configuration
​.coderabbit.yaml
Switched reviews.request_changes_workflow from true to false, disabling the automatic "request changes" workflow in the review configuration.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CodeRabbit
  participant GitHubAPI
  participant GHCLI

  User->>CodeRabbit: /merge-pr
  CodeRabbit->>GitHubAPI: fetch PR state & reviews
  alt dismissal attempt required
    CodeRabbit->>GitHubAPI: dismiss stale trusted-bot review(s)
    GitHubAPI-->>CodeRabbit: dismissal success
    CodeRabbit->>GHCLI: gh pr merge ...
    GHCLI-->>CodeRabbit: merge success/failure
  else dismissal fails
    CodeRabbit->>GitHubAPI: re-check pre-flight (OPEN, release label, checks, mergeStateStatus)
    CodeRabbit->>GitHubAPI: fetch all reviews -> classify as trusted-bot vs human
    alt only trusted-bots requested changes && pre-flight passes
      CodeRabbit->>GHCLI: gh pr merge ... --admin
      GHCLI-->>CodeRabbit: merge success/failure
      alt admin merge fails
        CodeRabbit->>User: instruct manual bot-review dismissal in GitHub UI + re-run /merge-pr
      end
    else human reviewers present
      CodeRabbit->>User: list human CHANGES_REQUESTED feedback, instruct fixes + re-run
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: preventing bot reviews from blocking the /merge-pr workflow through dismissal fallback and categorization logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fix-process-blockers-mC3Ov

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.

Ensure the --admin merge fallback requires re-verifying all other
pre-flight checks pass first, and update the failure handler to
acknowledge the fallback exists for bot-only blockers.

https://claude.ai/code/session_01CCLF7f32dWYYE1UXRL3S46
coderabbitai[bot]
coderabbitai bot previously requested changes Mar 24, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/commands/merge-pr.md:
- Around line 29-30: The admin-merge fallback weakens the guard by only checking
mergeStateStatus != DIRTY; tighten the admin path in the merge logic so it
enforces the same pre-flight checks as normal merges except it may bypass a
single bot CHANGES_REQUESTED review: require the standard allowlist of passing
status checks, release label, PR state, and that any CHANGES_REQUESTED reviews
are only from trusted bot identities before running gh pr merge --repo ...
--admin; update the conditional that currently checks mergeStateStatus to
instead validate the full pre-flight allowlist and verify all non-bot reviewers
have not requested changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8cdae546-95f9-4225-8593-ab2533337119

📥 Commits

Reviewing files that changed from the base of the PR and between 1ee2a5f and 54869fd.

📒 Files selected for processing (1)
  • .claude/commands/merge-pr.md

Address CodeRabbit review: the admin-merge fallback previously only
checked mergeStateStatus != DIRTY, which is weaker than the standard
pre-flight allowlist. Now explicitly requires PR OPEN, release label,
passing non-bot status checks, and mergeStateStatus in CLEAN/HAS_HOOKS/
UNSTABLE — matching step 2 exactly.

https://claude.ai/code/session_01CCLF7f32dWYYE1UXRL3S46
coderabbitai[bot]
coderabbitai bot previously requested changes Mar 24, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/commands/merge-pr.md:
- Line 30: The sentence about the remaining blocker is ambiguous; update the
text to allow multiple bot reviews by changing "the **only** remaining blocker
is trusted-bot `CHANGES_REQUESTED`" to a plural phrasing such as "the **only**
remaining blockers are trusted-bot `CHANGES_REQUESTED` reviews (no human
`CHANGES_REQUESTED`, no other blocking condition)" so it's clear that multiple
bot `CHANGES_REQUESTED` reviews are permitted when performing `gh pr merge
--repo bd73-com/fetchthechange --squash --delete-branch --admin`.
- Around line 29-30: Add an explicit verification step before the --admin bypass
instruction: ensure the script/documentation instructs to fetch all PR reviews
(re-use the "auto-resolve" reviews data if present) and verify that zero human
reviewers have state "CHANGES_REQUESTED" by filtering reviewers against the
trusted-bot allowlist referenced in the doc; place this bullet immediately
before the line that allows using `--admin` so the check is enforced before
attempting `gh pr merge --repo ... --admin`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c799eb47-4847-41c7-938a-1634ca8341d5

📥 Commits

Reviewing files that changed from the base of the PR and between 54869fd and f53f080.

📒 Files selected for processing (1)
  • .claude/commands/merge-pr.md

Address remaining CodeRabbit feedback: add an explicit step to verify
zero human reviewers have CHANGES_REQUESTED before --admin bypass, and
pluralize "blocker" to clarify multiple bot reviews are permitted.

https://claude.ai/code/session_01CCLF7f32dWYYE1UXRL3S46
@bd73-com bd73-com dismissed stale reviews from coderabbitai[bot] and coderabbitai[bot] March 25, 2026 12:40

Dismissing stale bot review — fixes were pushed in subsequent commits.

@bd73-com bd73-com merged commit 4af0e7b into main Mar 25, 2026
1 check passed
@bd73-com bd73-com deleted the claude/fix-process-blockers-mC3Ov branch March 25, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants