Skip to content

fix(pr): count only the latest run of each check - #5393

Merged
dan-petty merged 2 commits into
mainfrom
fix/5383-readiness-latest-check-run
Nov 13, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/5383-readiness-latest-check-run

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Each event of a pull request starts its workflows in a new check suite, and the REST check-runs API lists the latest run of a check in each suite. The reader dropped only a cancelled run that a newer run replaced, so the failed run of a push stayed beside the passed run of a close and reopen. devops pr ready refused the head of #5357 on that old failure, but the latest run of each check passed or was skipped, and gh pr checks showed the check as passed.

The REST reader now keeps the latest run of each check, whatever its conclusion. A check is a name and an app id. The time of a run is its started_at, else its completed_at. A run with no time, and each run at the latest time of its check, stays. A newer failure or cancel still fails the check. devops pr ready, devops pr check-readiness, devops pr monitor and the roadmap readiness rows read the same runs.

Closes #5383

Change: openspec/changes/archive/2026-11-13-5383-readiness-latest-check-run/

Each event of a pull request starts its workflows in a new check
suite, and the REST check-runs API lists the latest run of a check in
each suite. The reader dropped only a replaced cancelled run, so a
failed run of a push stayed beside the passed run of a close and
reopen. devops pr ready refused the head of #5357 with "The check
Fail-to-Pass Check failed.", but the latest run of each check passed
or was skipped.

The REST reader now keeps the latest run of each check, whatever its
conclusion. A check is a name and an app id. The time of a run is its
started_at, else its completed_at. A run with no time, and each run at
the latest time of its check, stays. pr ready, check-readiness, pr
monitor and the roadmap readiness rows read the same runs.

A recorded check-runs answer of the head of #5357 holds both runs.
Archive the change of #5383 and add its requirement to the capability pr-merge-readiness.
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/pr The devops pr commands labels Nov 13, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Review and test results

Head: 80c493b94, on origin/main 4ef7c6f11.

Fail-to-pass (uv run devops ci fail-to-pass --base origin/main): 9 failed on base, 103 passed (tests/commands/test_pr.py, tests/github/test_pr_check_verdict.py), 0 errored. All pass on the head. On the base, test_only_the_latest_run_of_each_check_counts[newest-listed-first] gave assert [<CheckBucket...FAIL: 'fail'>] == [<CheckBucket.PASS: 'pass'>].

Covering tests (uv run devops ci test tests/github/test_pr_check_verdict.py tests/commands/test_pr.py tests/github/test_merge_readiness.py tests/roadmap/test_roadmap_inbox.py tests/roadmap/stores/test_roadmap_store_contract.py): 356 passed in 8 s. The builder also ran the tests of the changed files (3,962 passed) and of 22 files that call the check-runs reader (728 passed).

Static rows and mypy (uv run devops ci --check --only lint,format,typecheck,domain,docs,openspec,test-tree,swallowed-failures,startup-imports,constructs,test-settings): all pass. The pre-push hook passed.

Render diff: none. The branch changes no path under k8s/ and no chart values, so no manifest changes and no pod restarts.

Review: the diff meets both acceptance criteria of #5383. Every reader of the check runs (read_check_runs, read_commit_checks) goes through _fetch_check_runs_from_rest, so pr ready, check-readiness, pr monitor, pr evidence, pr update, the release merge candidate and the roadmap readiness rows read the same runs. The recorded fixture holds only public run URLs of this repository. The review found no defect, so the branch has no review commit.

Points for the person who merges:

@dan-petty
dan-petty marked this pull request as ready for review November 13, 2026 09:22
@dan-petty
dan-petty merged commit 634dc91 into main Nov 13, 2026
24 checks passed
@dan-petty
dan-petty deleted the fix/5383-readiness-latest-check-run branch November 13, 2026 11:36
dan-petty pushed a commit that referenced this pull request Nov 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.127.1](v0.127.0...v0.127.1)
(2026-11-13)


### Bug Fixes

* **ci:** alarm at 360 s, one P0 issue, shards by recorded time
([#5377](#5377))
([2abd6ff](2abd6ff))
* **github:** read the plan diff and the release files from the merge
base ([#5401](#5401))
([c54e14c](c54e14c))
* **infra:** turn off the Ansible color of every playbook run
([#5381](#5381))
([5bafb1a](5bafb1a)),
closes [#5352](#5352)
* install-tools --check passes an older openspec binary
([#5355](#5355))
([625c89d](625c89d))
* **k8s:** allow only the Ingress origins in Open WebUI
([#5357](#5357))
([fdab229](fdab229))
* **pr:** count only the latest run of each check
([#5393](#5393))
([634dc91](634dc91))
* **review:** drop the fixed gateway URL of the review dry run
([#5399](#5399))
([0666d3d](0666d3d))
* **review:** review a pull request at the merge base of its base branch
([#5387](#5387))
([351ba2a](351ba2a)),
closes [#5346](#5346)
* **roadmap:** end fix-plan at a time budget with a result line
([#5380](#5380))
([20468f4](20468f4)),
closes [#5363](#5363)
* **roadmap:** refine skips an item that changed during the write
([#5392](#5392))
([a863dda](a863dda))
* **roadmap:** stage writes RENAMED and REMOVED spec deltas
([#5367](#5367))
([4abbbd2](4abbbd2))
* **roadmap:** title the delivery by the summary of its plan
([#5376](#5376))
([10e1069](10e1069))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/pr The devops pr commands type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(pr): readiness counts a check run that a newer run replaced

1 participant