Skip to content

fix(hooks): pre-pr-review-gate should honor the /pre-doc-review marker#269

Merged
MSIH merged 1 commit into
mainfrom
fix/267-doc-gate
Jul 24, 2026
Merged

fix(hooks): pre-pr-review-gate should honor the /pre-doc-review marker#269
MSIH merged 1 commit into
mainfrom
fix/267-doc-gate

Conversation

@MSIH

@MSIH MSIH commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Closes #267

Summary

The gh pr create gate (pre-pr-review-gate.sh) only honored .pre-pr-review-done, so a doc-only PR that correctly passed /pre-doc-review (which writes .pre-doc-review-done) was still blocked. The gate now clears when either review marker holds the current HEAD SHA.

Changes

  • .claude/hooks/pre-pr-review-gate.sh — check both .pre-pr-review-done (code) and .pre-doc-review-done (doc-only) via a marker_matches helper; updated the header comment + deny message to name both markers and /pre-doc-review.
  • .claude/hooks/test-gates.sh — 4 new pre-pr-gate cases (spins a throwaway git repo for a real HEAD): no-marker → deny, doc-marker=HEAD → allow (fix(hooks): pre-pr-review-gate should honor the /pre-doc-review marker #267), code-marker=HEAD → allow (regression), stale doc marker → deny.

Verification

  • bash -n clean on both files.
  • .claude/hooks/test-gates.sh: 23/23 pass (incl. the 4 new cases).
  • Hook-only change — no src/** touched, server runs byte-identical (no smoke test applicable; verified per the "verify hooks instead" clause).

Test plan

The gate only checked .pre-pr-review-done, so a doc-only PR that passed
/pre-doc-review (which writes .pre-doc-review-done) was still blocked.
Accept either marker at the current HEAD; add test-gates.sh coverage.
Closes #267.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YKt6y3Rk498eBqneiMKHpM
Copilot AI review requested due to automatic review settings July 24, 2026 21:20
@MSIH MSIH added the bug Something isn't working label Jul 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes the PR-creation gate to accept doc-only review approval by honoring the /pre-doc-review marker, aligning hook behavior with the documented workflow and issue #267 acceptance criteria.

Changes:

  • Updated pre-pr-review-gate.sh to allow PR creation when either .pre-pr-review-done or .pre-doc-review-done matches the current HEAD SHA.
  • Added gate acceptance tests covering allow/deny behavior for missing, matching, and stale doc/code markers using a real throwaway git repo.

Reviewed changes

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

File Description
.claude/hooks/pre-pr-review-gate.sh Treats /pre-doc-review marker as sufficient (in addition to /pre-pr-review) when it matches HEAD.
.claude/hooks/test-gates.sh Adds regression/acceptance test cases for the updated pre-PR gate marker logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MSIH
MSIH merged commit c804f1a into main Jul 24, 2026
6 checks passed
@MSIH
MSIH deleted the fix/267-doc-gate branch July 24, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(hooks): pre-pr-review-gate should honor the /pre-doc-review marker

3 participants