Skip to content

fix: draft-PR guard on the caller - #16

Merged
cansin merged 3 commits into
mainfrom
ci/draft-gate-on-caller
Aug 30, 2026
Merged

cansin merged 3 commits into
mainfrom
ci/draft-gate-on-caller

Conversation

@cansin

@cansin cansin commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

One line, long overdue: the mirror's header documents the draft gate as the caller's job, but the caller never carried it — drafts got blocking self-hosted reviews. Surfaced when bly's first Claude review flagged the identical omission in the caller copied from here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LjEWDajYkRMzCdEUhw44jc

The mirror's header has always documented the draft gate as the caller's
job; the caller never carried it, so drafts received blocking self-hosted
reviews. The gap surfaced when bly's first Claude review caught the same
omission in its freshly-copied caller.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LjEWDajYkRMzCdEUhw44jc
@cansin
cansin enabled auto-merge (squash) August 30, 2026 17:34
@github-actions

Copy link
Copy Markdown
Contributor

Automated review by claude (mode: agentic)

Verdict: PASS — The review found no must-fix issues, describing the change as a correct, minimal draft-gate addition.

No issues found — the change is a correct, minimal draft-gate addition.

@github-actions

Copy link
Copy Markdown
Contributor

Automated review by claude (mode: agentic)

Verdict: FAIL — The workflow trigger omits ready_for_review, so draft PRs marked ready without a new push never get the required check and can permanently block merge under the documented branch-protection setup.

One finding: the new draft gate skips the job on opened for drafts, but the workflow's trigger types: [opened, synchronize] omits ready_for_review — so a draft PR marked ready without a subsequent push never gets the required claude-review / PR review check, which can permanently block merge under the required-check branch protection described in the file's own header comment.

… absence a deadlock

Flagged by the claude gate on this very PR: with the draft gate, a draft
marked ready without a new push fired no event, so the required check
stayed 'expected' forever. Same trigger list as grove and bly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LjEWDajYkRMzCdEUhw44jc
@github-actions

Copy link
Copy Markdown
Contributor

Automated review by claude (mode: agentic)

Verdict: PASS — The review found no correctness bugs, security issues, or violated invariants in the draft-PR gating change to the workflow file.

Reviewed the full diff — it's a small, self-contained change to .github/workflows/claude-code-review.yml:

  1. Adds reopened and ready_for_review to the pull_request trigger types.
  2. Adds if: ${{ github.event.pull_request.draft == false }} to the claude-review job (which calls the reusable _claude-review.yml via uses:).

Logic check:

  • draft is a genuine boolean in the pull_request payload, so == false compares correctly (no stringly-typed footgun).
  • Skipping a job with if: on a uses:-based (reusable-workflow) job correctly prevents the reusable workflow from being instantiated at all, rather than reporting a skipped/green check — matches the comment's claim that this avoids poisoning a required check with a false pass.
  • ready_for_review firing sets draft: false in that event's payload, so adding it to types combined with the new if gate does mint the check exactly once when a draft is published without a new commit — closing the gap described in the comments.
  • Draft PRs on opened/synchronize are correctly skipped (no premature check run), and non-draft PRs on all four listed events still run.

No correctness bugs found: the trigger-list change and the job-level draft gate are consistent with each other and with the stated intent, and I don't see an edge case in the four event types where draft would be stale or misreported at fire time.

@cansin
cansin merged commit 3e91141 into main Aug 30, 2026
4 checks passed
@cansin
cansin deleted the ci/draft-gate-on-caller branch August 30, 2026 17:56
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