fix(pull-request): prioritize failed checks #12274
main fromrefs/pull/12274/head·merged by juliusmarminge View on GitHubFailed and cancelled checks can be buried among passing checks in the PR Summary tab.
The shared check mapper now puts failures and cancellations first after selecting the newest run of each check. It preserves provider order within both groups and retains timestamp comparison and workflow-name disambiguation. GitHub and Forgejo use this mapper; Bitbucket also orders the final combined pages, and GitCafe uses the same ordering without deduplicating its checks.
Credit to @akash3444 for the original fix in #12274. This maintainer takeover retains the original commits and merges current main.
Verification:
- Six focused suites: 255 → 256 tests. One new core regression checks cancellation priority, stable groups, and a passing rerun replacing an older failure. Existing timestamp coverage is retained. Existing Bitbucket pagination and GitCafe mapping fixtures were strengthened without adding tests.
- Core/GitHub/Bitbucket JSON: 150 passed / 5 expected failures → 155 passed. The two revised API/mapping fixtures gave 76 passed / 2 expected failures → 78 passed. Forgejo adds 23 passing tests, for 256 total.
- Broader verification: 615 tests across 22 scoped source-control files passed. The existing GitCafe provider pagination expectation was updated for failure-first ordering (24 passed / 1 failed → 25 passed), with no added tests.
- Scoped source-control lint, formatting, and typechecks passed; one existing lint warning remains in the GitCafe provider test.
- Linux web verification used the running app's actual PR Summary tab with isolated cached fixture data. The same entries were passed through the actual base and head helpers, then loaded through the app's existing detail-snapshot cache. This verifies the visible ordering; it does not claim live provider API sessions. The web popover and mobile apply their existing independent status grouping. Mobile's ranking still places pending checks before cancelled checks; this PR makes no mobile display-order claim. GitLab supplies one pipeline check and Azure DevOps supplies no checks, so neither needs list ordering.
Before — base helper output:

After — head helper output:

Not exercised: macOS, Windows, iOS, Android, Electron desktop, or a second remote environment.
Implemented with Codex gpt-6.1-sol; tests by Codex gpt-6-astra; independent reviews by Claude claude-opus-5-5 and Codex gpt-6-sol through T3 Code delegate_task.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
Approvability#
Verdict: Approved at
03abb02Macroscope's review found this PR approvable — This is a small, focused fix that reorders existing pull-request checks so failed and cancelled results appear first, without changing check data or workflow behavior. The shared helper and provider expectations are covered by focused tests, and no sensitive, configuration, schema, or deployment files are involved.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Warning
Review limit reached#
Only developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing.
Next included review available in 5 minutes.
View limit details
-
Limit details: You’ve used all 10 included reviews currently available.
Review configuration:
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
4ec75abe-6a30-4048-8a52-280ca440045b
📥 Commits
-
Reviewing files that changed from the base of the PR and between bed9a43a8b0ea5e314a3cf8739fe98732a4989df and 79724d551d7b764724eac9eb9a61adfd24eb1c6e.
📒 Files selected for processing: 10
-
packages/source-control-bitbucket/src/server/BitbucketPullRequestApi.test.tspackages/source-control-bitbucket/src/server/BitbucketPullRequestApi.tspackages/source-control-bitbucket/src/server/bitbucketPullRequestJson.test.tspackages/source-control-core/src/server/pullRequestChecks.test.tspackages/source-control-core/src/server/pullRequestChecks.tspackages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.tspackages/source-control-gitcafe/src/server/GitCafePullRequestProvider.test.tspackages/source-control-gitcafe/src/server/gitCafePullRequestJson.test.tspackages/source-control-gitcafe/src/server/gitCafePullRequestJson.tspackages/source-control-github/src/server/gitHubPullRequestJson.test.ts
-
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
dd6f6f6e-5129-4e55-a2b8-44f8e7a99bae
📥 Commits
-
Reviewing files that changed from the base of the PR and between 2491227037b4c0e0534c8cbbcc14ef517a47253e and bed9a43a8b0ea5e314a3cf8739fe98732a4989df.
📒 Files selected for processing: 9
-
packages/source-control-bitbucket/src/server/BitbucketPullRequestApi.test.tspackages/source-control-bitbucket/src/server/BitbucketPullRequestApi.tspackages/source-control-bitbucket/src/server/bitbucketPullRequestJson.test.tspackages/source-control-core/src/server/pullRequestChecks.test.tspackages/source-control-core/src/server/pullRequestChecks.tspackages/source-control-gitcafe/src/server/GitCafePullRequestProvider.test.tspackages/source-control-gitcafe/src/server/gitCafePullRequestJson.test.tspackages/source-control-gitcafe/src/server/gitCafePullRequestJson.tspackages/source-control-github/src/server/gitHubPullRequestJson.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
📝 Walkthrough
-
The shared pull-request check utilities now sort failed and cancelled checks before other statuses. Bitbucket and GitCafe apply this ordering to returned checks. Tests across core and provider packages cover ordering, status mapping, pagination, and check names.
Changes: Check ordering
Layer / File(s) Summary Prioritize failed and cancelled checks
packages/source-control-core/src/server/pullRequestChecks.ts,packages/source-control-core/src/server/pullRequestChecks.test.tsThe exported sortCheckshelper places failed and cancelled checks before other statuses.dedupeChecksapplies the ordering to its results. Core tests cover status priority and check ordering.Apply ordering in provider check results
packages/source-control-bitbucket/src/server/BitbucketPullRequestApi.ts,packages/source-control-bitbucket/src/server/BitbucketPullRequestApi.test.ts,packages/source-control-bitbucket/src/server/bitbucketPullRequestJson.test.ts,packages/source-control-gitcafe/src/server/gitCafePullRequestJson.ts,packages/source-control-gitcafe/src/server/gitCafePullRequestJson.test.ts,packages/source-control-gitcafe/src/server/GitCafePullRequestProvider.test.ts,packages/source-control-github/src/server/gitHubPullRequestJson.test.tsBitbucket and GitCafe sort their returned checks with sortChecks. Provider tests update expected ordering and cover status and name mappings. The GitHub test expects a failed check before a pending check.Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to
bed9a-
Failed and cancelled checks are prioritized as intended, with no identified issue requiring resolution before merge.
Pre-merge checks:
3 · 1-
Failed checks: 1 warningCheck name Status Explanation Resolution Description check The description provides clear problem, change, and verification details. It does not include a dedicated Scope and approval section or provide the required triaged issue or explicit maintainer approv… Add a Scope and approval section. Link the triaged issue or approval discussion, include the explicit maintainer approval comment, and explain why the change is within the approved scope. Passed checks: 3 passed-
Check name Status Explanation Title check The title clearly and concisely describes the main change: failed checks receive priority in pull request check ordering. Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request.
Full details: Description check
-
Explanation
The description provides clear problem, change, and verification details. It does not include a dedicated Scope and approval section or provide the required triaged issue or explicit maintainer approval for the behavior change.
Resolution
Add a Scope and approval section. Link the triaged issue or approval discussion, include the explicit maintainer approval comment, and explain why the change is within the approved scope.
-
Comment `@coderabbitai help` to get the list of available commands.✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
-
Note
This comment is posted by Julius' dot
The screenshots show the visibility problem: failed checks sit among many successful checks. The patch replaces
dedupeChecks’ documented provider-order behavior with failed/cancelled-first ordering for every consumer, and updates the provider expectations accordingly.Can a maintainer confirm that status priority should replace provider order, including cancelled checks? No direction is linked or recorded here. The prior-approval rule asks for agreement on intentional behavior changes. Leaving this open for that focused ordering decision; the supplied screenshots and stable-within-group regression coverage are useful.
Note
Written by
claude-opus-5-5on behalf of MariaHi! We are cleaning up open PRs, and this one appears to have been created with an older model (
gpt-5.6-sol). If this change is really important, we recommend rebuilding the PR with a newer model if possible.maria-rcks closed this
Note
Written by
claude-opus-5-5on behalf of MariaReopening, this was closed by mistake. Sorry for the noise!
maria-rcks reopened this
juliusmarminge assignedjuliusmarminge
Taking over this one as maintainer for batch misc-01. Failed and cancelled checks should appear first, preserving provider order within each group. I will adapt the shared implementation to the current source-control packages, retain the original commits, and run focused tests and independent reviews. This work will remain unmerged.
juliusmarminge merged this03c1a76
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes