Phase 3 (Q7): gate CI on required status checks only#5
Merged
Conversation
"CI passing" now means "required checks passing" (Q7, resolves T5). The tool previously treated every failing check as blocking, so a non-required check (optional/informational, e.g. CodeQL) made a mergeable PR look broken — stricter than the repo's own merge policy. - AcceptableGiven gains a `required` set: when non-empty, only those checks can block; a non-required red check never blocks and the agent need not chase it. - Empty/unreadable required set falls back to ALL checks (review M2), so a vacuously-satisfied "required passing" can never let an all-red PR read as acceptable. - New Client.RequiredChecks reads branch protection's required-status-checks for the base branch, memoised per branch for the client's lifetime (one read per base branch per cycle, shared across PR goroutines). It degrades safely: branch protection unconfigured (404), no admin scope on the token (403), or any error → empty set → all-checks gating, with a warning. No new hard token requirement. - Wired into the orchestrator's routing gate and both implementation CI gates (fix loop + post-squash), fetched once per run. The Q12 no-progress floor automatically scopes to required checks through this, since it counts whatever AcceptableGiven deems blocking. NOTE: reading branch protection needs an admin-scoped token to take effect; on repos/tokens without it the tool keeps today's all-checks behaviour. Tests: TestCIStatusAcceptableGiven gains required-gating cases (only-required- blocks, non-required-acceptable, empty→all-checks fallback, ignored-wins). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
38ce35d to
71dd9c2
Compare
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.
Phase 3 sub-item Q7 (
docs/WORKPLAN.md; resolves T5). The new CI bar.Problem (T5)
AcceptableGiventreated every failing check as blocking, so a non-required check (optional/informational, e.g. CodeQL) made a perfectly mergeable PR look broken — stricter than the repo's own merge policy, and a contributor to chasing failures that don't gate merge.Fix (Q7 → a)
"CI passing" ≡ "required checks passing", everywhere.
AcceptableGivengains arequiredset. Non-empty → only those checks can block; a non-required red never blocks and the agent need not chase it.Client.RequiredChecks(branch)reads branch protection's required-status-checks, memoised per base branch for the client's lifetime (one read per base branch per cycle, shared across the PR goroutines).The Q12 no-progress floor (PR #3) automatically scopes to required checks via this — it counts whatever
AcceptableGivendeems blocking.To actually gate on required checks, the bot token needs admin scope to read branch protection. On
petemoore/taskcluster(owner) it works; for production the deployment token would need it. Until then it transparently falls back to all-checks.Tests
TestCIStatusAcceptableGivengains required-gating cases: only-required-blocks, non-required-acceptable, empty→all-checks fallback, ignored-still-wins.Local:
go build/vet/test ./...,gofmt,staticcheckall clean.🤖 Generated with Claude Code