Skip to content

refactor(roadmap): read the checks of the roadmap rows with gh pr checks #7510

Not planned

Description

@dan-petty

Problem

Part of #7499. read_check_runs (src/devops_cli/github/check_verdict.py:402-420) reads the REST check runs of a commit and removes the older runs with its own latest_run_of_each_check (:251-270, #5383). The roadmap steps ready, review, watch and fix-checks, the stage ready gate, the implement job, the plan check, github_store.py, watch_row.py, pr_evidence.py, branch_update.py and release/merge_candidate.py use it.

Change

  • Read the checks of a pull request with gh pr checks <n> --json name,state,bucket,workflow,link, and delete latest_run_of_each_check.
  • Check the premise first. The Service acts as a GitHub App whose token has checks: read and no statuses permission (feat(roadmap): the Service marks a stage pull request ready when its checks pass #2865). Confirm that the GraphQL statusCheckRollup that gh reads works with that token. Some callers read a commit and not a pull request, such as the head of main in release/merge_candidate.py:274: name a tool for them or keep that read.

Done when

  • latest_run_of_each_check is deleted, and each caller that judges a pull request reads gh pr checks.
  • A test proves the gh arguments of each caller and the map of the gh answer to its verdict.

Existing tool considered

GitHub CLI (https://github.com/cli/cli), MIT, v2.106.0. pkg/cmd/pr/checks/aggregate.go (eliminateDuplicates) keeps the newest run of each check.

Source

Source: #7499

Activity

  1. added
    type/refactor
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 28, 2026
  2. dan-petty commented on Nov 28, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 28, 2026
  4. dan-petty commented on Nov 28, 2026

    @dan-petty
    OwnerAuthor

    This item cannot be built as written. gh cannot give three reads that the roadmap rows need, and the part that gh can give deletes no source code. Evidence at origin/main 2669c9e, gh v2.106.0:

    1. Many pull requests in one read. The watch row reads the check rollup of up to 100 open pull requests in one GraphQL page (src/devops_cli/roadmap/watch_row.py:138 and :161-163, _process_poll at :934), and removes the older runs of each check with latest_run_of_each_check (_latest_contexts, :243-264). gh pr checks reads one pull request per call (Use: "checks [<number> | <url> | <branch>]", pkg/cmd/pr/checks/checks.go:62). One call per pull request would replace 1 GraphQL page with about 200 GraphQL queries for each round. latest_run_of_each_check must stay for this read.
    2. A read that spends no GraphQL points. While the GraphQL quota is under DEFAULT_GH_GRAPHQL_BUDGET_FLOOR (250 of 5,000 points), the watch row falls back to the REST read read_check_runs (watch_row.py:296-300, :888). gh pr checks reads only through GraphQL: PullRequestByNumber (pkg/cmd/pr/shared/finder.go:356-378) and then the status check rollup (checks.go, populateStatusChecks). It cannot be that fallback.
    3. The checks of a commit. release/merge_candidate.py:274 reads the checks of the head of main, a commit with no pull request. roadmap/steps/fix_checks_phases.py:666, steps/ready.py:57, steps/fix_checks.py:637, stage/stage_ready.py:175 and stores/github_store.py:1178 read the checks of the head that the step judged. gh selects a pull request, never a commit, so it reads the current head, which a push can move after the judgement.

    Pacing ledger. run_gh charges one gh pr checks call as 1 unit of graphql (("pr", "checks") in CONST_GH_GRAPHQL_PORCELAIN_COMMANDS, _detect_porcelain_resource in rate_limiter.py). gh sends at least 2 GraphQL queries per call, the finder and the rollup, and the porcelain output gives no rateLimit cost to charge. The ledger would under-count each moved read. Each REST page of read_check_runs is one request that the session counts.

    What gh could take. Only the two CLI callers with a pull request number, devops pr evidence (github/pr_evidence.py:113) and devops pr update (github/branch_update.py:144), could use read_pr_checks of #7508. That moves two REST reads to under-counted GraphQL reads, and deletes no line of check_verdict.py, because every row above still needs read_check_runs.

    Proposal. Close this item as not planned. read_check_runs stays as the REST, commit-addressed and ledger-counted read of the rows. latest_run_of_each_check (20 lines) stays for the batch rollup and the REST read, where gh has no equivalent.

  5. removed
    status/new
    on Nov 28, 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

    effort/mediumpriority/p2-mediumscope/roadmapsource/agenttype/refactorvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions