mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 09:27:29 +00:00
Distinguish cancelled PR checks from failures (#37789)
Show cancelled PR checks as Cancelled with separate counts on desktop and mobile, preserving genuine failures, pending checks, existing action permissions and older-client fallback. Carry complete provider summaries through caches and presentation; preserve Azure source completeness, folder attention priority and muted cancellation details. Tracked in #15847 and STA-5102.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { getProviderChecksOutcome } from '../provider-check-summary'
|
||||
import type { CheckStatus, ProviderCheckSummary } from './pull-request-types'
|
||||
import {
|
||||
canShowGitHubPRAutoMergeControl,
|
||||
@@ -41,7 +42,10 @@ export type GitHubPRMergeStateDecision = {
|
||||
|
||||
function checksState(item: GitHubPRMergeStateInput): CheckStatus | 'none' | undefined {
|
||||
if (item.checksSummary) {
|
||||
return item.checksSummary.state
|
||||
const outcome = item.checksStatus
|
||||
? getProviderChecksOutcome(item.checksSummary, item.checksStatus)
|
||||
: getProviderChecksOutcome(item.checksSummary)
|
||||
return outcome === 'cancelled' ? 'failure' : outcome
|
||||
}
|
||||
return item.checksStatus
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ export type PRInfo = {
|
||||
state: PRState
|
||||
url: string
|
||||
checksStatus: CheckStatus
|
||||
checksSummary?: ProviderCheckSummary
|
||||
updatedAt: string
|
||||
mergeable: PRMergeableState
|
||||
reviewDecision?: PRReviewDecision | null
|
||||
@@ -105,6 +106,8 @@ export type ProviderCheckSummary = {
|
||||
total: number
|
||||
passed: number
|
||||
failed: number
|
||||
/** Subset of failed; absent when cancellation detail is unavailable. */
|
||||
cancelled?: number
|
||||
pending: number
|
||||
neutral: number
|
||||
/** 'pipeline' when the state is a GitLab pipeline's own verdict, so its counts are not check counts. */
|
||||
|
||||
Reference in New Issue
Block a user