cli/pkg/cmd/pr/checks
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
..
fixtures Show cancelled checks (#7960) 2023-09-24 18:27:01 +02:00
aggregate.go fix(pr status): don't count cancelled checks as failures 2026-03-11 12:33:31 -06:00
checks.go fix: --interval flags docs in gh pr checks 2025-10-30 20:06:45 +00:00
checks_test.go fix(pr status): don't count cancelled checks as failures 2026-03-11 12:33:31 -06:00
output.go Deprecate ColorScheme.Gray for ColorScheme.Muted 2025-04-06 10:18:48 -04:00