AR-99: add pr-reviewer merge-on-green handling#57
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
📝 WalkthroughWalkthroughThis PR implements merge-on-green automation with Slack support. The agent now evaluates PR readiness based on labels, checks, and bot approvals, routes Slack messages to a dedicated merge handler, extends webhook parsing for issue-based PR references, and orchestrates merge decisions through a centralized event gate. ChangesMerge-on-green with Slack integration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
…agents # Conflicts: # review/agent.ts
|
pr-reviewer could not complete review for #57 in AgentWorkforce/agents. |
|
ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed. pr-reviewer could not complete review for #57 in AgentWorkforce/agents. |
|
pr-reviewer could not complete review for #57 in AgentWorkforce/agents. |
4 similar comments
|
pr-reviewer could not complete review for #57 in AgentWorkforce/agents. |
|
pr-reviewer could not complete review for #57 in AgentWorkforce/agents. |
|
pr-reviewer could not complete review for #57 in AgentWorkforce/agents. |
|
pr-reviewer could not complete review for #57 in AgentWorkforce/agents. |
|
ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed. pr-reviewer could not complete review for #57 in AgentWorkforce/agents. |
* fix(pr-reviewer): read PR state from GitHub VFS instead of gh CLI The sandbox snapshot ships no `gh` binary, so the two `gh pr view` calls added by the READY-sentinel guard (e981031) and merge-on-green (#57) failed every run with `spawn gh ENOENT` — breaking the ready ping and auto-merge. Rebuild the same PullRequestReadyState the gates consume from the github adapter's VFS projection instead: • pulls/{n}/meta.json → state, draft, labels, head.sha • pulls/{n}/checks/_summary.json → the aggregated CI rollup • pulls/{n}/reviews/*.json → latest review per author The adapter doesn't project mergeability, so conflict detection is delegated to the merge API (mergePullRequest throws on a dirty PR — never auto-merges). All reads fail closed: a missing/empty projection yields a state the gates treat as not-ready/pending, never a green light. The tested pure evaluators are unchanged; only the data source moved off gh. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(pr-reviewer): harden VFS review/check parsing (PR #73 review) - loadReviews: guard the map so a malformed reviews/*.json entry can't throw out and blank the whole review set (which would drop an active CHANGES_REQUESTED and risk merging a blocked PR). - rollupFromCheckSummary: derive `total` from failed+pending+passed when it's missing/malformed, so a summary with real counts but no `total` still reports the actual check states instead of being treated as "no checks". - Document why mergeable defaults to MERGEABLE (VFS doesn't project it) and that safety rests on the merge API rejecting a conflicted PR, not on this field. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Summary
merge-on-greenhandling inside thereviewpr-reviewer agent across AgentWorkforce reposValidation
cloud#2061 was closed unmerged per dispatcher correction. Do not merge this PR without human approval.
Summary by cubic
Adds merge-on-green to the PR reviewer so PRs in the
AgentWorkforceorg auto-merge when labeled and all gates pass. Also lets Slack users ask the reviewer to merge; it merges if green or replies with blockers. (Linear AR-99)New Features
merge-on-green, PR open and not draft, no conflicts, green checks, requested bot reviewers approved, and no bot “changes requested”.issues.labeled, commitstatus,check_run.completed, review submissions, and sync/open events; resolves PRs from commit-status SHAs.Refactors
/slack/channels/**so channel writebacks work for merge replies.Written for commit 752976a. Summary will update on new commits.