cli/pkg/cmd/pr
Kynan Ware 1c274a8a56 fix(pr status): don't count cancelled checks as failures
When a GitHub Actions workflow uses concurrency with cancel-in-progress,
cancelled runs were counted as failures in `gh pr status` and
`gh pr view`, even when a newer run for the same check name succeeded.
The GitHub web UI and `gh pr checks` both handle this correctly.

Three changes fix this:

1. Add a `cancelled` check status category. Cancelled runs are now
   excluded from all summary counts (passing/failing/pending) and
   subtracted from the total, matching the web UI behavior.

2. Move `eliminateDuplicates` from pkg/cmd/pr/checks to
   `api.EliminateDuplicateChecks` (exported). The function operates
   entirely on `api.CheckContext` and is now shared by both `pr checks`
   and `ChecksStatus()` (used by `pr status` and `pr view`).

3. Apply deduplication in the `ChecksStatus()` slow path, keeping only
   the most recent run per check name — consistent with `pr checks`.

Fixes #12895

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-11 12:33:31 -06:00
..
checkout fix(pr checkout): add alias co 2025-09-24 14:56:59 +01:00
checks fix(pr status): don't count cancelled checks as failures 2026-03-11 12:33:31 -06:00
close Cleanup run command stubbed finders in tests 2025-05-02 14:48:52 +02:00
comment Add --delete-last option to pr comment and issue comment (#10596) 2025-05-01 14:12:55 +01:00
create Merge pull request #12627 from cli/kw/pr-create-multi-select-with-search-ccr 2026-03-06 10:24:19 -07:00
diff Merge branch 'trunk' into feature/pr-diff-exclude 2026-03-09 19:35:51 +05:30
edit Add missing TODO comments for featuredetection if-statements 2026-02-16 14:24:32 -07:00
list Add missing TODO comments for featuredetection if-statements 2026-02-16 14:24:32 -07:00
merge test(pr merge): always assert stderr 2025-07-05 15:02:41 +01:00
ready Cleanup run command stubbed finders in tests 2025-05-02 14:48:52 +02:00
reopen Cleanup run command stubbed finders in tests 2025-05-02 14:48:52 +02:00
revert Return only basic pull request info when reverting a PR 2025-10-22 18:02:35 -04:00
review Cleanup run command stubbed finders in tests 2025-05-02 14:48:52 +02:00
shared Merge pull request #12627 from cli/kw/pr-create-multi-select-with-search-ccr 2026-03-06 10:24:19 -07:00
status fix(pr status): don't count cancelled checks as failures 2026-03-11 12:33:31 -06:00
update-branch chore: remove redundant word in comment 2025-03-12 16:13:46 +08:00
view Add generic actorDisplayName for all actor display names 2026-03-06 11:55:09 -07:00
pr.go feat: implement pr revert 2025-10-06 13:25:31 -04:00