Skip to content

automerge: R6, merge only when every review thread is resolved (+ R3 test) - #1081

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/r6-review-thread-gate
Nov 13, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
claude/r6-review-thread-gate

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Owner ruling R6 (2026-11-13): auto-merge only when all review threads are resolved. Today nothing checks threads, so #1072 and #1073 merged with open bot findings.

  • New pr_threads_ready FULL NUM in scripts/sweeps/lib/merge-ready.sh. It reads the PR's review threads through GraphQL (resolution state is not in REST) and is called by scripts/sweeps/estate-pr-automerge.sh for every auto_merge row at --execute, right after merge_ready.
  • Blocks with unresolved_review_threads:<n>. Fails closed with check_unavailable:review_threads when the answer is unreadable or there are more than 100 threads.
  • docs/operations/estate-automerge.adoc: the execute-time gate list names it.

Limit: this covers the estate sweep at the moment it queues a merge. GitHub's native auto-merge (--auto) waits for threads opened later only if the ruleset requires conversation resolution. That is an owner setting, not part of this PR.

R3 (the template upgrade wave never auto-merges) needs no code: the sweep already blocks every PR not authored by a dependency bot (not_a_dependency_bot). This PR adds a test that pins it.

Test plan

  • test/pr-automerge-sweep-test.sh (the stub gh now serves GraphQL per PR number): an open thread, a GraphQL 502 and an unread second page each stop the merge with the reason logged; all threads resolved merges again; R3: a non-bot PR is flagged and never merged.
  • Removing the call from the sweep makes the first R6 case fail.
  • bash -n on the changed scripts. ShellCheck is not installed in this session; CI runs it.

Generated by Claude Code

Owner ruling R6 (2026-11-13): auto-merge only when all review threads
are resolved. #1072 and #1073 merged with open bot findings because
nothing checked threads.

pr_threads_ready (scripts/sweeps/lib/merge-ready.sh) reads the PR's
review threads through GraphQL (resolution state is not in REST) and is
called for every auto_merge row at --execute, after merge_ready. It
blocks with unresolved_review_threads:<n>, and fails closed with
check_unavailable:review_threads when the answer is unreadable or there
are more than 100 threads.

Tests (stub gh now serves GraphQL per PR number): an open thread, a 502
and an unread second page each stop the merge with the reason logged;
all-resolved merges again; R3, a PR not authored by a dependency bot
(e.g. the template upgrade wave) is flagged and never merged. Removing
the call makes the first case fail.

This gate covers the sweep. GitHub's native auto-merge waits for later
threads only if the ruleset requires conversation resolution, which is
an owner setting.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0136P7Zo6VBPrBWYUmDJZR1H
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9f11f9ed-5045-44e1-bb77-2fc3a9fb02b2
Commits

Reviewing files that changed from the base of the PR and between 709f0ec and 81b6f9b.

Files selected for processing: 4

  • docs/operations/estate-automerge.adoc
  • scripts/sweeps/estate-pr-automerge.sh
  • scripts/sweeps/lib/merge-ready.sh
  • test/pr-automerge-sweep-test.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Name the threads() parameters, use one constant for the PR 7 merge
marker, and [[ ]] for the R3 check. No behaviour change; the sweep
test still passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0136P7Zo6VBPrBWYUmDJZR1H
@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 13, 2026 19:58
@hyperpolymath
hyperpolymath merged commit 2b09352 into main Nov 13, 2026
98 checks passed
@hyperpolymath
hyperpolymath deleted the claude/r6-review-thread-gate branch November 13, 2026 19:58
@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T20:06:32.676060Z 81b6f9b Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

3 participants