Require a fresh Copilot pass before merging any PR#694
Merged
Conversation
Document the rule that mergeStateStatus=CLEAN alone is not enough to merge — Copilot must have re-reviewed the latest commit after any thread resolutions or pushes. If Copilot does not auto re-review within a reasonable window, ask before merging; silence is not approval. This was missing from the previous round of process documentation. PR #693 was merged ~3 minutes after I (Claude) replied to Copilot's threads, before Copilot had a chance to post a fresh review on the new commit. The merge happened to be functionally correct but the process was wrong, and it's the kind of small step that hides real regressions in larger PRs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Document the rule that, immediately after a develop->main merge lands and main's publish workflows complete, the next action is a small isolated PR bumping the minor in version.json on develop. Without it, develop's next NBGV prerelease is numerically lower than the stable that just shipped, producing visibly confusing version numbers in HISTORY.md, --version output, and consumer update prompts. Documentation only; the actual bump for the just-completed PR #693 promotion will land as a separate `bump-version-3.17` PR per the "don't bundle the bump with other work" guidance in this same change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Codifies an operational merge policy to ensure a pull request is not merged until copilot-pull-request-reviewer has re-reviewed the latest commit (so “CLEAN” mergeability/ruleset gates aren’t mistaken for “Copilot has re-evaluated the newest changes”).
Changes:
- Added an “Merging a PR” section to
AGENTS.mddescribing how to verify Copilot’s review is fresh relative to the PR head commit. - Added a one-line rule to
.github/copilot-instructions.mdpointing contributors back toAGENTS.mdfor the full procedure.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| AGENTS.md | Adds a new “Merging a PR” section documenting the required fresh Copilot review check and a CLI-based verification recipe. |
| .github/copilot-instructions.md | Adds a short rule reinforcing the fresh Copilot re-review requirement and links to the detailed procedure in AGENTS.md. |
Address four issues Copilot raised on the previous commit: - Clarify that review_on_push lives in the copilot_code_review ruleset rule (verifiable via gh api), not in repo source files. - Align the "no issues found" headline with the verification recipe by stating up front that Copilot posts COMMENTED reviews here, so a clean COMMENTED review with zero open threads IS the success state. - Specify committedDate as the exact field to compare submitted_at against, removing ambiguity between authoredDate and committedDate in `gh pr view --json commits` output. - Replace "ask the user" with "ask the maintainer" since this is a repo-wide doc that survives author changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot pointed out (rightly) that comparing submitted_at against committedDate is fragile: the reviews endpoint returns every author's every review, and timestamp drift between client and server can flip the comparison. The robust check is structural — does the latest Copilot review's commit_id equal headRefOid? Recipe rewritten to fetch headRefOid and the last Copilot review's commit_id and compare strings. Also added a pointer to the GitHub UI "Re-request review" flow for cases where Copilot doesn't auto re-review on push (which happens occasionally; observed on this PR). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- AGENTS.md headline said the freshness check was "review submitted after committedDate" but step 2 specifies commit_id == headRefOid. Aligned the headline to also use the SHA-equality wording so the rule is internally consistent end-to-end. - copilot-instructions.md: "develop's next prerelease numbers below main's just-shipped stable" was missing a verb. Now reads "next prerelease version numbers fall below..." Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Round 5 Copilot findings: - Use `copilot-pull-request-reviewer[bot]` (the bot login, with "(shown as Copilot in the UI)" gloss) consistently in prose so it matches the jq filter in the verification recipe — copy/paste from the doc now produces a working command. - The reviews endpoint is paginated by default in gh CLI; on PRs with many review entries `last` could pick a stale Copilot review from page 1. Use `--paginate` and a streaming `tail -1` filter so the latest Copilot commit_id is reliably found regardless of review-list length. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Merging-a-PR section mixed `<repo>` and `<owner>/<repo>` in adjacent gh api recipes; copy-pasting the bare `<repo>` form would fail. Standardised on `<owner>/<repo>` to match the rest of the doc. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Codifies the rule the user gave me after PR #693 was merged before Copilot had a chance to re-review my replies on the resolved threads.
mergeStateStatus: CLEANonly confirms ruleset gates (thread resolution, status checks, signatures) — it does not confirm Copilot has actually re-evaluated the latest changes.New rule: never merge a PR without a fresh "no issues found" review from
copilot-pull-request-revieweron the latest commit. If Copilot doesn't auto re-review within a reasonable window after the latest push (~5 min), ask before merging; silence is not approval.Documented in:
gh api repos/<repo>/pulls/<n>/reviews+gh pr view <n> --json commitsto confirmsubmitted_at > head commit's timestamp).This PR is itself an opportunity to dogfood the rule: it should not be merged until Copilot posts a fresh review on this commit and clears it.
Test plan
🤖 Generated with Claude Code