Code review skill: warn before approving PRs with auto-merge enabled#15997
Code review skill: warn before approving PRs with auto-merge enabled#15997
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15997Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15997" |
There was a problem hiding this comment.
Pull request overview
Updates the GitHub PR code review skill instructions to avoid unintentionally triggering auto-merge when a user asks to approve a PR while also posting review comments.
Changes:
- Adds an “Auto-merge safety check” step that queries
autoMergeRequestviagh pr viewbefore approving with comments. - Introduces a user prompt to either proceed with approval or downgrade to a comment-only review.
- Tightens Step 6 submission guidance to gate
"APPROVE"usage behind explicit user intent and the safety check.
| 3. **Submit the review**: | ||
| Use `mcp_github_pull_request_review_write` with method `submit_pending`: | ||
| - If any comments were posted: `event: "COMMENT"`, with a summary body listing the number of issues found by category. Do not use `"REQUEST_CHANGES"` unless the user explicitly asks for it. | ||
| - If any comments were posted: `event: "COMMENT"`, with a summary body listing the number of issues found by category. Do not use `"REQUEST_CHANGES"` unless the user explicitly asks for it. Do not use `"APPROVE"` unless the user explicitly asks for it **and** the auto-merge safety check above has passed or been acknowledged. |
There was a problem hiding this comment.
The "Submit the review" guidance is internally inconsistent: it says "If any comments were posted: event: "COMMENT"", which prevents the very "approve with comments" flow described in the new Auto-merge safety check section. Consider updating Step 6.3 to explicitly allow event: "APPROVE" when (a) the user explicitly requested approval with comments and (b) the auto-merge safety check was acknowledged/passed; otherwise default to event: "COMMENT" when comments exist.
| - If any comments were posted: `event: "COMMENT"`, with a summary body listing the number of issues found by category. Do not use `"REQUEST_CHANGES"` unless the user explicitly asks for it. Do not use `"APPROVE"` unless the user explicitly asks for it **and** the auto-merge safety check above has passed or been acknowledged. | |
| - If any comments were posted: | |
| - Use `event: "APPROVE"` only if the user explicitly asked to approve with comments **and** the auto-merge safety check above has passed or been acknowledged. | |
| - Otherwise, use `event: "COMMENT"`. | |
| - In either case, include a summary body listing the number of issues found by category. Do not use `"REQUEST_CHANGES"` unless the user explicitly asks for it. |
- Restructure auto-merge check trigger as a clear precondition - Replace ambiguous 'passed or acknowledged' with explicit conditions - Flatten nested bullets into mutually exclusive if/then rules
Description
When the code review skill is asked to approve a PR with comments, and that PR has auto-merge enabled, the approval could trigger an automatic merge before the author has a chance to address the review comments.
This change adds an auto-merge safety check to Step 6 of the code review skill. Before submitting an APPROVE review with comments, the skill now:
gh pr view --json autoMergeRequestChecklist