🐛 Add CHANGES_REQUESTED pre-merge guard to pr-review prompt - #87
Merged
Conversation
The pr-review agent prompt now requires checking `gh pr view ... --jq` for unresolved CHANGES_REQUESTED reviews before any merge action. If any exist, the agent must address the requested changes, reply to inline comments, push a fix commit, and re-request review instead of merging.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #86.
The
pr-reviewagent has been merging PRs that had unresolvedCHANGES_REQUESTEDreviews (seeweyucou/ellen-core#118). The agent hasBash(gh:*,git:*)access and the prompt never instructed it to check review state before any merge action.This change adds a
Pre-merge guard (CHANGES_REQUESTED)block toREVIEWPR_AGENT_PROMPTinaskcc/definitions.pythat:gh pr view <number> -R <owner/repo> --json reviews --jq '[.reviews[] | select(.state == \"CHANGES_REQUESTED\")]'before merging.Key Flows
```mermaid
flowchart TD
A[pr-review starts] --> B[Pre-review: read diff, run tests]
B --> C[Pre-merge guard: gh pr view --jq CHANGES_REQUESTED]
C -->|none| D[Definition of Done checklist]
C -->|any| E[Address changes + reply inline + push fix + re-request review]
E --> F[Stop, do NOT merge]
D --> G[Post review via gh pr review]
```
Verification
Followed red/green TDD: 4 new tests in `TestReviewprPromptMergeGuard` were added first and confirmed failing, then the prompt was updated to make them pass.
Test plan