Skip to content

refactor(github): read a pull request's checks once, fail-closed, for wait, monitor and readiness #769

Closed

Description

@dan-petty

Context & Rationale

#707 made classifying a pull request's checks deep: one BUCKET_CLASSIFIER_MAP whose tests need no patches. Reading the checks is still written three times (github/check_verdict.py:251, github/pr_monitor.py:405, commands/pr.py:1274), with three error behaviours: an unread_reason, [] and RuntimeError. pr_monitor turns a failed check-runs read into "no checks", where #707 required an unread read to block. The seam is runner: Any = run_gh at the argv level, so tests script side_effect lists in call order (tests/test_pr_check_verdict.py:223-249).

Scope & Deliverables

Strategic Alignment

  • Milestone: Backlog (no release)
  • Design: none
  • Depends on: none

Amendment (2026-10-01 assessment)

  • Context:
  • Deliverable: When a head SHA has zero check runs and zero statuses, the shared reader reports it as pending ('no checks reported'). This applies to pr wait, the monitor and readiness alike.
  • Acceptance criteria: A scripted read that returns zero runs and zero statuses yields a pending verdict naming 'no checks reported' in all three consumers.
  • Constraint: The feat(github): fail-closed pr check verdicts from one bucket classifier #707 classifier table and its parity test stay as they are.

Consolidated from #797 (commit-statuses half)

Problem (added). Commit statuses are read without pagination in two places, commands/pr.py:1321-1342 (_fetch_commit_statuses_payload, called at :1359) and github/pr_monitor.py:454. So only the first 30 contexts are seen, and the combined state is ignored. They belong to the read this item unifies: the amendment above already reads statuses for its zero-runs rule.

Acceptance criteria (added).

  • The shared reader reads commit statuses in full (paginated), or it uses the combined state. A scripted test covers a head with more than 30 contexts and one failing context past the first page. The result blocks in pr wait, the monitor and readiness.
  • A statuses read that cannot be read blocks and names the reason (unread_reason), the same way an unread check-runs read does.

Notes. #797 keeps its review-threads half and the two #665 tests, and lands first on today's code, as #998's key question proposes. This item and #797 become sub-issues of #998 (one readiness verdict), together with #806. The v0.2.28 placement and P1 are unchanged.

Activity

  1. added
    type/refactor
    scope/github
    priority/p2-medium
    on Oct 1, 2026
  2. added
    priority/p1-high
    and removed
    priority/p2-medium
    on Oct 2, 2026
  3. added this to the v0.2.28 milestone on Oct 2, 2026
  4. dan-petty commented on Oct 2, 2026

    @dan-petty
    OwnerAuthor

    Grooming (2026-10-02): Priority p2-medium → p1-high. pr check-readiness and pr checks/wait pass a head with zero check runs, which was observed on PR #828 after GITHUB_TOKEN pushes. That is a fail-open merge gate.

    Placed in v0.2.28, one of its slots held for P1 work that surfaced after it was planned. Value High, effort Medium. Ready.

    Checked against the code at the release/v0.2.25 tip.

  5. added a commit that references this issue on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/githubtype/refactor

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions