fix(github): block applies when a required check has not reported#300
Conversation
There was a problem hiding this comment.
Pull request overview
This PR closes a fail-open gap in the GitHub “passing checks” apply gate when required_checks is configured: required checks that have not yet reported on the commit are now treated as blocking (in-progress) so apply cannot proceed until they appear.
Changes:
- Treat configured required checks absent from fetched PR statuses as in-progress blockers and include them in the apply-blocked comment.
- Add logging to distinguish total in-progress blockers vs. missing-required blockers.
- Add unit/integration-style tests covering missing required checks behavior and enforcePassingChecks end-to-end comment output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/webhook/apply_gating.go | Adds missing-required detection and folds missing required checks into the in-progress apply gate path. |
| pkg/webhook/apply_gating_test.go | Adds coverage for missingRequiredChecks and new enforcePassingChecks scenarios where required checks haven’t reported yet. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7758175 to
b26aefd
Compare
|
The fail-closed mechanics are right:
Verdict: needs changes for the message; mechanics are sound. 🤖 This review was generated by Claude Code (claude-fable-5) with maintainer approval. |
When required_checks is configured, the passing-checks apply gate only evaluated the required checks GitHub had already reported on the commit. A configured required check that had not reported yet neither failed nor counted as in-progress, so the apply could proceed before that check ran. Treat every configured required check absent from the fetched statuses as a not-yet-reported in-progress blocker, mirroring how a legacy commit status in the EXPECTED state maps to in_progress. The gate now fails closed and names the missing required check(s) so the operator knows what to wait for. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… and logging A configured required check that GitHub has never reported on the PR commit was surfaced through the in-progress blockers, so the operator saw the "checks still running, wait and retry" guidance. For the realistic causes of a missing report — a typo in required_checks, a check not configured on the repo, or a path-filtered workflow — waiting never resolves, sending the operator into an indefinite wait. Render the never-reported checks in their own section of the apply-blocked comment with remediation that tells the operator to verify the name in required_checks matches the check exactly and that it runs on the PR. In-progress checks keep the wait-and-retry guidance. The block log names the never-reported required checks so triage does not require reproducing the gate. Reject a required_checks entry that names SchemaBot's own aggregate check (the base name or its environment-scoped form) at config load: SchemaBot checks are excluded from the passing-checks gate, so such an entry would be silently unenforced. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
b26aefd to
27c5118
Compare
When
required_checksis configured, the passing-checks apply gate only evaluated the required checks GitHub had already reported on the PR commit. A configured required check that had not reported yet neither failed nor counted as in-progress, so the apply could proceed before that check ever ran — a fail-open gap in a tier-0 safety gate.This treats every configured required check that is absent from the fetched statuses as a not-yet-reported in-progress blocker, mirroring how a legacy commit status in the
EXPECTEDstate maps toin_progress. The gate now fails closed and the apply-blocked comment names the missing required check(s) so the operator knows what still has to report.🤖 Generated with Claude Code