Skip to content

Require a fresh Copilot pass before merging any PR#694

Merged
ptr727 merged 7 commits into
developfrom
copilot-pass-rule
May 8, 2026
Merged

Require a fresh Copilot pass before merging any PR#694
ptr727 merged 7 commits into
developfrom
copilot-pass-rule

Conversation

@ptr727
Copy link
Copy Markdown
Owner

@ptr727 ptr727 commented May 7, 2026

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: CLEAN only 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-reviewer on 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:

  • AGENTS.md — new "Merging a PR" section with the verification recipe (gh api repos/<repo>/pulls/<n>/reviews + gh pr view <n> --json commits to confirm submitted_at > head commit's timestamp).
  • .github/copilot-instructions.md — one-line rule with link back to AGENTS.md.

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

  • CI green
  • Copilot posts fresh review on this commit
  • No new inline threads (or threads addressed and re-reviewed)
  • Squash-merge into develop
  • Once on develop, promote to main as a normal develop → main PR

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings May 7, 2026 23:15
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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md describing how to verify Copilot’s review is fresh relative to the PR head commit.
  • Added a one-line rule to .github/copilot-instructions.md pointing contributors back to AGENTS.md for 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.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread AGENTS.md Outdated
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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread AGENTS.md Outdated
Comment thread .github/copilot-instructions.md Outdated
- 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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread .github/copilot-instructions.md Outdated
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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@ptr727 ptr727 merged commit 661b945 into develop May 8, 2026
20 checks passed
@ptr727 ptr727 deleted the copilot-pass-rule branch May 8, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants