Repository navigation
Description
Problem
#769 made check_verdict the single fail-closed reader of a pull request's checks. One of its criteria: "A statuses read that cannot be read blocks and names the reason (unread_reason)". The commit-status read has one path that breaks this. If the runner raises StopIteration or IndexError, the read returns no statuses and an empty reason, and the verdict is computed from check runs alone [code: src/devops_cli/github/check_verdict.py:353-356]. Checked at bbc644b, the head of release/v0.2.28. The clause came in with #769 and is not on main.
try:
res = runner(status_cmd, check=False, quiet=True)
except StopIteration, IndexError:
return [], None, ""-
The read fails open. In a probe, the first call returned one successful check run. For the second call (statuses):
- a non-zero exit gave
unread_reason='GitHub commit status API error: …', which blocks; IndexErrororStopIterationgaveunread_reason=''and a passing verdict [measured: probe at bbc644b].
The check-runs read has no such clause [code: src/devops_cli/github/check_verdict.py:327].
- a non-zero exit gave
-
It is a test shim. Without the clause, three tests fail [measured: pytest with the clause removed, 3 failed / 271 passed]:
test_fetch_pr_check_verdicts_rest_fallback_on_cli_failure[code: tests/test_pr_check_verdict.py:202];test_rest_pagination_slurp_bucket_count_matches_total_count[code: tests/test_pr_check_verdict.py:318];TestPrCommands::test_pr_checks_fallback_on_gh_failure[code: tests/test_pr_cmd.py:892].
Each scripts a
MagicMock(side_effect=[...])list that has no/statusresponse. The mock runs out and raisesStopIteration, and the production code swallows it. A test that forgets the status call therefore passes as if the head had no statuses. -
Reach. Every production caller passes
run_gh[code: src/devops_cli/commands/pr.py:352, :403, :1040, :1292; src/devops_cli/github/pr_monitor.py:441; src/devops_cli/roadmap/run.py:362].run_ghdoes not raise either exception for this argv [code: src/devops_cli/github/rate_limiter.py:1893]. The fail-open is latent: only a test double reaches it today. If a future change maderun_ghraiseIndexError, readiness would pass while a status context fails.
Acceptance criteria
-
_fetch_commit_statuses_from_resthas notry/exceptaround the runner call. An exception from the runner propagates, exactly as it does from the check-runs read, andrg -n "except StopIteration" src/devops_cli/githubprints nothing. - The three tests above script the
/statusresponse, so each runs every call it makes and asserts on statuses as well as check runs. - A scripted test: check runs pass and the status read raises.
fetch_pr_check_verdictsdoes not return a passing verdict. -
changelog.d/<n>.mdrecords the change under### Fixed.CHANGELOG.mdanddocs/ROADMAP.mdare not edited. -
uv run devops cipasses.
Strategic alignment
- Milestone: none; the roadmap tooling places it.
- Related: refactor(github): read a pull request's checks once, fail-closed, for wait, monitor and readiness #769 (the fail-closed reader this restores), fix(github): pr readiness passes when review threads can't be read #797 (other fail-open readiness reads), refactor(github): pr readiness is one verdict module that the pr commands, the monitor and mcp consume #998 (the readiness verdict built on this reader), test(github): github/ is tested through its public interface over the gh process and session fakes, with no internal patches or private imports #1321 (github/ tests move to process fakes scripted by argv, where an unscripted call is refused instead of raising
StopIteration), refactor(github): the github session owns transport, ledger, error classes and link pagination #983 (the session replaces therunnerparameter). - Source: local LLM code review 20261007-203945, finding 2. The review rated it HIGH and suggested
except Exception: raise, which changes nothing. The verified severity is low.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty-bot commentedon Oct 7, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
The fail-open is latent—no production caller can trigger it today, only a test double reaches it, and the candidate's own review rates verified severity as low.It undermines the fail-closed guarantee and lets three tests pass incorrectly, but no user-facing misbehaviour is reachable in production at present.The fix is removing one try/except block and updating three existing tests to script the /status response.fix(github): fail closed on commit-status runner exceptions and stop …
dan-petty commentedon Oct 21, 2026
What changed
#1766, merged into
release/v0.2.38as acb3569.5 file(s) changed.
How it was verified
Check runs at 1f4fda2:
Acceptance Criteria of
docs/agent/tasks/task-1350-commit-status-fail-closed.md:No Acceptance Criteria section.
feat(release): v0.2.38 (#1799)
feat(release): v0.2.38 (#1798)