From c2f79818c8803ecb015f188f77605014684494ba Mon Sep 17 00:00:00 2001 From: Mattias Granlund Date: Thu, 30 May 2024 11:57:00 +0200 Subject: [PATCH] Show PR checks progress as error if any check has failed --- app/src/lib/components/PullRequestCard.svelte | 2 +- app/src/lib/github/service.ts | 1 + app/src/lib/github/types.ts | 17 +++++++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/src/lib/components/PullRequestCard.svelte b/app/src/lib/components/PullRequestCard.svelte index 1922cbded..9bbc89c0b 100644 --- a/app/src/lib/components/PullRequestCard.svelte +++ b/app/src/lib/components/PullRequestCard.svelte @@ -154,7 +154,7 @@ } return { - style: 'warning', + style: status.failed > 0 ? 'error' : 'warning', icon: 'spinner', text: getChecksCount(status) }; diff --git a/app/src/lib/github/service.ts b/app/src/lib/github/service.ts index 7417854a2..be5e3c034 100644 --- a/app/src/lib/github/service.ts +++ b/app/src/lib/github/service.ts @@ -381,6 +381,7 @@ export class GitHubService { startedAt: firstStart, hasChecks: !!totalCount, success, + failed, completed, queued, totalCount, diff --git a/app/src/lib/github/types.ts b/app/src/lib/github/types.ts index 6f614f38c..760e7539b 100644 --- a/app/src/lib/github/types.ts +++ b/app/src/lib/github/types.ts @@ -60,14 +60,15 @@ export function parseGitHubDetailedPullRequest( export type ChecksStatus = | { - startedAt?: Date; - completed?: boolean; - success?: boolean; - hasChecks?: boolean; - queued?: number; - totalCount?: number; - skipped?: number; - finished?: number; + startedAt: Date; + completed: boolean; + success: boolean; + hasChecks: boolean; + failed: number; + queued: number; + totalCount: number; + skipped: number; + finished: number; } | null | undefined;