Skip to content

feat(branch-protection): require review-thread resolution as fleet standard#26

Open
mabry1985 wants to merge 1 commit into
mainfrom
feat/require-thread-resolution
Open

feat(branch-protection): require review-thread resolution as fleet standard#26
mabry1985 wants to merge 1 commit into
mainfrom
feat/require-thread-resolution

Conversation

@mabry1985
Copy link
Copy Markdown
Contributor

What

Makes review-thread resolution a fleet branch-protection standard: every ecosystem repo that adopts apply-branch-protection now gates merge on required_review_thread_resolution: true. A review comment from Quinn / CodeRabbit / a human can't be silently merged past — the thread must be addressed and resolved first. CI-pass alone is no longer sufficient to merge.

This is the org-wide counterpart to the protoMaker local-pipeline work: we review the diff locally before GitHub, and now GitHub itself enforces that review feedback actually gets resolved.

Why no forced approval count

Org policy is that bots gate via review decision / thread resolution, not a forced required_approving_review_count (which a bot identity often can't satisfy, and which would stall a solo/small-team board). So this flips thread resolution on and leaves approval counts untouched.

Changes

  • lib/branch-protection.mjsapplyRecommendedDefaults adds/patches the pull_request rule with required_review_thread_resolution: true; preserves any existing PR-rule params; surfaces threadResolutionBefore/After in the diff; opt-out via requireThreadResolution: false.
  • bin/apply-branch-protection.mjs--no-thread-resolution flag + diff line.
  • docs/reference/branch-protection-defaults.md — new "### 3." section.
  • test/branch-protection.test.mjs — 3 new cases (adds rule, preserves existing PR params, opt-out). All pass.

Test

node --test test/branch-protection.test.mjs   # 16 pass, 0 fail

🤖 Generated with Claude Code

…andard

Adds required_review_thread_resolution:true to applyRecommendedDefaults so
every ecosystem repo gates merge on resolved review threads. A review comment
from Quinn / CodeRabbit / a human can no longer be silently merged past — the
thread must be addressed and resolved first. CI-pass alone is not sufficient.

Deliberately does NOT force required_approving_review_count: org policy is that
bots gate via review decision / thread resolution, not a forced approval a bot
identity often can't satisfy. Existing PR-rule params (approval counts,
code-owner requirements) are preserved; only thread resolution is flipped on.

- lib/branch-protection.mjs: add/patch the pull_request rule, surface
  threadResolutionBefore/After in the diff, opt-out via requireThreadResolution
- bin/apply-branch-protection.mjs: --no-thread-resolution flag + diff output
- docs: new "### 3." section in branch-protection-defaults.md
- tests: 3 new cases (adds rule, preserves existing PR params, opt-out)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@protoquinn
Copy link
Copy Markdown

protoquinn Bot commented May 26, 2026

👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow.

Copy link
Copy Markdown

@protoquinn protoquinn Bot left a comment

Choose a reason for hiding this comment

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

QA Audit — PR #26 | feat(branch-protection): require review-thread resolution as fleet standard

VERDICT: PASS


CI Status

  • Lint + smoke test: ✅ success

Diff Review
Org-wide branch-protection standard: all apply-branch-protection calls now gate on required_review_thread_resolution: true, surfacing the change in the diff output. --no-thread-resolution provides a documented opt-out path.

  • lib/branch-protection.mjs: applyRecommendedDefaults adds/patches the pull_request rule; reads prior state (including when the field is false) before writing, so the reported diff is accurate.
  • diff.threadResolutionAfter is set to true only when called with requireThreadResolution: true or default; when opt-out is chosen it reflects the prior value — no field is created with false where none existed. Consistent with the doc intent.
  • required_approving_review_count is deliberately set to 0 when creating a new PR rule, leaving approval counts untouched per org policy.
  • 3 new test cases cover all branches (no rule → adds, existing rule → updates preserving params, opt-out → no rule added). 16 tests pass.

Observations

  • LOW/INFO: When requireThreadResolution: false the function walks away entirely rather than creating a pull_request rule with required_review_thread_resolution: false. Intentionally avoids writing field at all — matches the docs — but worth confirming against GitHub API's handling of absent vs. explicit-false fields.
  • CLAWPATCH: Not mounted for this repo — proceeding on diff evidence alone.

Checks: 5 | Passed: 5 | Failed: 0 | Gaps: 0

— Quinn, QA Engineer

@protoquinn
Copy link
Copy Markdown

protoquinn Bot commented May 26, 2026

Submitted APPROVE review on #26.

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.

1 participant