chore: review workflow supports merge conflicts — Phase A0 before CI failures - #35
Conversation
…failures Backport of zoolutions/phlex-reactive#220, adapted to this repo: - New /github-review-pr orchestrator: Phase A0 (merge conflicts) runs before CI failures, which run before review comments. Detection via gh pr view --json mergeable with a local git merge-tree fallback that tests the PR's actual head (git fetch origin pull/<PR>/head + FETCH_HEAD), ref verification before trusting exit codes, and the --name-only conflict list as the work list. Resolution is merge-never-rebase with repo-specific semantic rules. - /github-ci-failures gains a detection-only merge-conflict pre-flight that hands off to the orchestrator, plus a check-name table matching the actual CI jobs (Lint, Gem Tests, Docs Lint, Docs Tests). - allowed-tools frontmatter now covers every command each runbook instructs (gh pr list/checkout, git fetch/merge/merge-tree/rev-parse/ status/switch, bundle install, bun, docs bin/rubocop).
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a new ChangesPR review orchestration runbooks
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant ReviewPR as /github-review-pr
participant CIFailures as /github-ci-failures
participant ReviewComments as /github-review-comments
participant GitHub
User->>ReviewPR: invoke with PR number/branch
ReviewPR->>GitHub: gh pr view (confirm PR)
ReviewPR->>GitHub: check mergeable state
alt CONFLICTING
ReviewPR->>ReviewPR: resolve conflicts, push merge commit
else UNKNOWN or MERGEABLE
ReviewPR->>ReviewPR: proceed
end
ReviewPR->>CIFailures: delegate Phase A
CIFailures->>GitHub: gh pr checks / fetch logs
CIFailures-->>ReviewPR: exit criteria met
ReviewPR->>ReviewComments: delegate Phase B
ReviewComments->>GitHub: gh pr list / resolve threads
ReviewComments-->>ReviewPR: exit criteria met
ReviewPR->>GitHub: re-check mergeability/CI
ReviewPR-->>User: final report
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.claude/commands/github-ci-failures.md (1)
14-18: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winUnblock the blank-argument PR lookup.
git branch --show-currentis used here, butBash(git branch:*)isn’t in this command’s allowlist, so the auto-detect path will fail before it can resolve a PR. Add the permission or switch the snippet to a whitelisted branch lookup.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.claude/commands/github-ci-failures.md around lines 14 - 18, The auto-detect path in the `$ARGUMENTS` parsing flow uses `git branch --show-current`, which is blocked by the current allowlist and will fail before `gh pr list` runs. Update the command in the `github-ci-failures` snippet to either use a whitelisted way to determine the current branch or add the needed `git branch` permission so the empty-argument PR lookup can resolve correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/commands/github-review-pr.md:
- Around line 37-43: The auto-detect PR lookup uses git branch --show-current
inside the gh pr list command, but that git subcommand is not permitted by this
file’s toolset. Update the branch lookup in the github-review-pr command to use
the already-whitelisted git rev-parse --abbrev-ref HEAD, or otherwise add git
branch to the allowed tools, so the existing PR detection flow remains
executable.
---
Outside diff comments:
In @.claude/commands/github-ci-failures.md:
- Around line 14-18: The auto-detect path in the `$ARGUMENTS` parsing flow uses
`git branch --show-current`, which is blocked by the current allowlist and will
fail before `gh pr list` runs. Update the command in the `github-ci-failures`
snippet to either use a whitelisted way to determine the current branch or add
the needed `git branch` permission so the empty-argument PR lookup can resolve
correctly.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 68f0d0e6-d968-40d6-8d75-25a7572faeda
📒 Files selected for processing (4)
.claude/commands/github-ci-failures.md.claude/commands/github-review-comments.md.claude/commands/github-review-pr.mdCLAUDE.md
Summary
Adds a merge-conflict-aware full-review workflow: a new
/github-review-prorchestrator whose Phase A0 (merge conflicts) runs before the CI-failures phase, which runs before review comments.Phase A0: detection via
gh pr view --json mergeable, with a localgit merge-tree --write-tree --name-onlyfallback forUNKNOWNthat tests the PR's ACTUAL head (git fetch origin pull/<PR>/head+FETCH_HEAD, never the localHEAD), verifying both refs resolve before trusting merge-tree's exit code. Resolution:gh pr checkout, merge never rebase (the branch is shared; force-push is forbidden), semantic per-file rules, verification gates before pushing, plaingit push. Loop-back rules: a new conflict mid-pass returns to A0; a new CI failure during comment work returns to Phase A. Phase C reports the A0 outcome (conflicted files, resolutions, merge SHA)./github-ci-failuresgains a detection-only pre-flight: onCONFLICTINGit stops and hands off to the orchestrator (its toolset deliberately lacks the merge machinery); onUNKNOWNit proceeds.Repo-specific adaptations (verified against this repo, not copied)
/github-ci-failures(not phlex-reactive's/github-review-failures) and/github-review-comments.Gemfile.lock,docs/Gemfile.lock(re-resolve viabundle install), anddocs/bun.lock(bun installindocs/). (In phlex-reactive onlydocs/Gemfile.lockis tracked.)rake release[X.Y.Z]aborts off-mainand pushes the bump directly toorigin/main, so alib/daisy_ui/version.rbconflict means the branch bumped on purpose.lib/daisy_ui/updated_at.rbis machine-written each release → take the base's side.register_modifiersmerges must preserve the responsive variant comments (# "sm:...") above every modifier — Tailwind scans them; a merge that drops one silently breaks responsive classes.tailwind.sources.cssare gitignored, so phlex-reactive's min.js/vendored-twin regeneration rules were dropped — everything tracked merges semantically.bundle exec rubocop lib spec,bundle exec rspec, and fordocs/:bin/rubocop,bun run lint:js,bun run lint:css,bun run build:css && bundle exec rspec.Lint,Gem Tests (Ruby 3.2/3.3/3.4/4.0),Docs Lint,Docs Tests; run URLs point atmhenrixon/daisyui.gh pr list/checkout,git fetch/merge/merge-tree/rev-parse/status/switch,bundle install,bun, docsbin/rubocop); existingmodel: opuspins preserved./github-review-pr.Backport of zoolutions/phlex-reactive#220.
Summary by CodeRabbit