You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(roadmap): read the checks of the roadmap rows with gh pr checks #7510
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.
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/main2669c9e, gh v2.106.0:
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.
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.
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.
Activity
dan-petty commentedon Nov 28, 2026
Both read a pull request's checks, but #769 unifies the read and makes it fail-closed while the candidate replaces the REST API call with gh pr checks and removes the dedup helper.refactor(pr): read the readiness checks with gh pr checks (#7519)
dan-petty commentedon Nov 28, 2026
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/main2669c9e, gh v2.106.0:src/devops_cli/roadmap/watch_row.py:138and:161-163,_process_pollat:934), and removes the older runs of each check withlatest_run_of_each_check(_latest_contexts,:243-264).gh pr checksreads 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_checkmust stay for this read.DEFAULT_GH_GRAPHQL_BUDGET_FLOOR(250 of 5,000 points), the watch row falls back to the REST readread_check_runs(watch_row.py:296-300,:888).gh pr checksreads 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.release/merge_candidate.py:274reads the checks of the head ofmain, 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:175andstores/github_store.py:1178read 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_ghcharges onegh pr checkscall as 1 unit ofgraphql(("pr", "checks")inCONST_GH_GRAPHQL_PORCELAIN_COMMANDS,_detect_porcelain_resourceinrate_limiter.py). gh sends at least 2 GraphQL queries per call, the finder and the rollup, and the porcelain output gives norateLimitcost to charge. The ledger would under-count each moved read. Each REST page ofread_check_runsis 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) anddevops pr update(github/branch_update.py:144), could useread_pr_checksof #7508. That moves two REST reads to under-counted GraphQL reads, and deletes no line ofcheck_verdict.py, because every row above still needsread_check_runs.Proposal. Close this item as not planned.
read_check_runsstays 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.