fix: count cancelled github checks as failed (#4077)

This commit is contained in:
Neil 2026-05-31 03:31:12 -07:00 committed by GitHub
parent 1dd9f85bf6
commit bdacd8469f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View File

@ -80,6 +80,17 @@ describe('hostedReviewSummaryFromGitHubPRInfo', () => {
expect(summary.checksStatus).toBe('failure')
})
it('treats cancelled checks as failed in hosted review summaries', () => {
const summary = hostedReviewSummaryFromGitHubPRInfo({
pr: { ...pr, checksStatus: 'success' },
owner: 'acme',
repo: 'orca',
checks: [{ name: 'ci', status: 'completed', conclusion: 'cancelled', url: null }]
})
expect(summary.checksStatus).toBe('failure')
})
it('distinguishes loaded empty comments from unknown comments', () => {
expect(
hostedReviewSummaryFromGitHubPRInfo({

View File

@ -36,7 +36,10 @@ function deriveChecksStatus(
return prChecksStatus
}
const hasFailure = checks.some(
(check) => check.conclusion === 'failure' || check.conclusion === 'timed_out'
(check) =>
check.conclusion === 'failure' ||
check.conclusion === 'timed_out' ||
check.conclusion === 'cancelled'
)
if (hasFailure) {
return 'failure'