Repository navigation
Description
Problem
In the REST fallback of the row watch, read_check_runs (src/devops_cli/roadmap/watch_row.py, about line 514) runs before the failed-head backoff test (about lines 304-310). While GraphQL is on hold, the row reads the check runs of a failed head in each round, also inside its 30-minute backoff. This breaks openspec/specs/roadmap-watch-row/spec.md line 23 (a failed head is not read again within the backoff). Found in the vet of plan #5993 for #3671.
Expected behavior
- In the REST fallback, the row tests the backoff before it reads the check runs, so a failed head in its backoff costs no REST request.
- A test in
tests/roadmap/test_roadmap_watch_row.pycounts zero check-run reads for a failed head inside the backoff while GraphQL is on hold.
Related
- fix(roadmap): stage_ready backs off after a failed check #3671 (closed: done by feat(roadmap): one watch row for plan and delivery PRs #5906), feat(roadmap): one watch row for plan and delivery PRs #5906, ADR 0021 section 8.
Alternatives check of 2026-11-24: none.
Tool: none found.
Reason: Searches returned only unrelated generic Python and test-mocking references; no open, maintained tool or library decides the order of a backoff test before a check-run read in this project's own watch row, so the fix is internal code plus a test.
Lacks:
- Backoff test before the REST check-run read
- Zero check-run reads for a head in backoff
- Shared failed-head guard for REST and GraphQL paths
Proposed design
Problem statement
The REST fallback of the watch row reads check runs before it tests the failed-head backoff. A failed head in its 30-minute backoff thus costs a REST check-run read in each round while GraphQL is on hold. This breaks the roadmap-watch-row spec. The fix moves the backoff test before the check-run read and adds a test that counts zero check-run reads.
Acceptance criteria
Requirement: REST fallback tests backoff before check-run read
In the REST fallback, the watch row SHALL test the failed-head backoff before it reads the check runs.
Scenario: Failed head in backoff under GraphQL hold
- WHEN the GraphQL quota is on hold, the REST fallback processes a pull request, and the ledger holds a failed entry for the same head and base with next_read_at later than the current time
- THEN the row adds the pull request to failed_heads, sends no call to read_check_runs, and sends no REST request for its check runs
Requirement: Zero check-run reads in backoff
A test in tests/roadmap/test_roadmap_watch_row.py MUST count zero check-run reads for a failed head inside the backoff while GraphQL is on hold.
Scenario: REST fallback skips the check-run read
- WHEN the test runs watch_round in the REST fallback with a failed ledger entry whose next_read_at is 10 minutes later and a fake client that counts check-run reads
- THEN the test asserts the count is zero and the result lists the pull request in failed_heads
Existing Tool Considered
The alternatives check in the issue body (2026-11-17) gives the verdict none with no tool. No open, maintained tool or library covers the need; the block lists the lacks. This change is an internal code-order fix plus a test.
Key questions
- Which code path reads check runs before the failed-head backoff test?: The REST path calls read_check_runs in _process_rest_pulls before it calls _evaluate_pull. The backoff test lives in _evaluate_pull, so the check-run read happens first. [sources: src/devops_cli/roadmap/watch_row.py, openspec/specs/roadmap-watch-row/spec.md]
- Where should the REST fallback put the failed-head backoff test?: Add a shared helper that tests the ledger entry for an active backoff. Call it in _process_rest_pulls before read_check_runs, and continue when it holds. Call the same helper in _evaluate_pull so the GraphQL path keeps the same ledger behavior. (best practice) [sources: src/devops_cli/roadmap/watch_row.py, openspec/specs/roadmap-watch-row/spec.md, tests/roadmap/test_roadmap_watch_row.py]
- Chosen: Early guard in _process_rest_pulls with a shared helper. It stops the REST check-run read before it happens and keeps one backoff rule for both paths.
- Rejected: Keep the backoff test only in _evaluate_pull. The REST path still reads check runs before the test, so the defect stays.
- Rejected: Pass a lazy check-run reader into _evaluate_pull. It adds a callback to the evaluation path and gives no benefit over an early guard.
- Should the early REST skip add the pull request to failed_heads?: Yes. The existing backoff branch in _evaluate_pull adds the pull request to failed_heads. The early REST skip must keep that result so WatchRoundResult.failed_heads keeps its meaning. (best practice) [sources: src/devops_cli/roadmap/watch_row.py, tests/roadmap/test_roadmap_watch_row.py]
- Chosen: Add the pull request to failed_heads. It keeps the result of the row the same as the existing backoff branch.
- Rejected: Skip the pull request silently. It changes WatchRoundResult.failed_heads and hides the backoff from callers and tests.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 16, 2026
Both address backoff after a failed check in roadmap rows, but the candidate reorders the backoff test before the REST read in watch_row while #3671 added backoff to stage_ready.devops-cli-service commentedon Nov 17, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (3)
Searches run:
Sources:
devops-cli-service commentedon Nov 18, 2026
Status set to Ready at c62c598 (see proposed design in issue body).
chore(main): release 0.219.0 (#7177)
devops-cli-service commentedon Nov 25, 2026
Released in v0.219.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.219.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 17:09 UTC