fix(hooks): pre-pr-review-gate should honor the /pre-doc-review marker#269
Merged
Conversation
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
There was a problem hiding this comment.
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.shto allow PR creation when either.pre-pr-review-doneor.pre-doc-review-donematches the currentHEADSHA. - 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.
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.
Closes #267
Summary
The
gh pr creategate (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 amarker_matcheshelper; updated the header comment + deny message to name both markers and/pre-doc-review..claude/hooks/test-gates.sh— 4 newpre-pr-gatecases (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 -nclean on both files..claude/hooks/test-gates.sh: 23/23 pass (incl. the 4 new cases).src/**touched, server runs byte-identical (no smoke test applicable; verified per the "verify hooks instead" clause).Test plan
/pre-doc-reviewcan nowgh pr createwithout a manual second marker — the exact case hit opening PR docs: reconcile 03/05/README/08/09 with shipped code #266 this session.