diff --git a/mobile/src/tasks/mobile-tasks-provider-detail-types.ts b/mobile/src/tasks/mobile-tasks-provider-detail-types.ts index bb2ed8bbada..6976859f1e6 100644 --- a/mobile/src/tasks/mobile-tasks-provider-detail-types.ts +++ b/mobile/src/tasks/mobile-tasks-provider-detail-types.ts @@ -246,7 +246,7 @@ export type DetailPayload = comments: DetailComment[] labels: string[] assignees: string[] - pipelineJobs: Array<{ + pipelineJobs: { id?: number name: string stage: string @@ -254,7 +254,7 @@ export type DetailPayload = allowFailure?: boolean webUrl?: string | null duration?: number | null - }> + }[] } | { provider: 'linear' diff --git a/src/renderer/src/components/editor/check-details/panel/CheckRunDetailsPanel.tsx b/src/renderer/src/components/editor/check-details/panel/CheckRunDetailsPanel.tsx index d17904031fc..cf4ac05046a 100644 --- a/src/renderer/src/components/editor/check-details/panel/CheckRunDetailsPanel.tsx +++ b/src/renderer/src/components/editor/check-details/panel/CheckRunDetailsPanel.tsx @@ -322,6 +322,7 @@ export function CheckRunDetailsPanel({ return hasJobs ? ( 0} positionOwner={positionOwner} diff --git a/src/renderer/src/components/editor/check-details/panel/CheckRunJobs.tsx b/src/renderer/src/components/editor/check-details/panel/CheckRunJobs.tsx index d6a34b58ced..fa66d49fcc0 100644 --- a/src/renderer/src/components/editor/check-details/panel/CheckRunJobs.tsx +++ b/src/renderer/src/components/editor/check-details/panel/CheckRunJobs.tsx @@ -1,9 +1,21 @@ import React from 'react' -import { CheckCircle2, ChevronDown, CircleDashed, MinusCircle, XCircle } from 'lucide-react' +import { + AlertTriangle, + CheckCircle2, + ChevronDown, + CircleDashed, + MinusCircle, + XCircle +} from 'lucide-react' +import { isGitLabAllowedFailureJob } from '@/components/github/pr-check-presentation' import { CheckJobLogTail } from '@/components/right-sidebar/checks-panel/logs/check-job-log-tail' import { useTranslate } from '@/i18n/use-translate' import { cn } from '@/lib/utils' -import type { PRCheckJob, PRCheckStep } from '../../../../../../shared/github/check-types' +import type { + PRCheckDetail, + PRCheckJob, + PRCheckStep +} from '../../../../../../shared/github/check-types' import { resolveStepOutcome, summarizeJobSteps, @@ -105,10 +117,12 @@ function OtherJobSteps({ } function JobCard({ + check, job, identity, owner }: { + check: PRCheckDetail job: PRCheckJob identity: string owner?: CheckDetailsReadingOwner @@ -149,7 +163,9 @@ function JobCard({ return (
- {jobFailed ? ( + {isGitLabAllowedFailureJob(check, job) ? ( + + ) : jobFailed ? ( ) : ( @@ -202,10 +218,12 @@ function JobCard({ } export function CheckRunJobs({ + check, jobs, hasFailedJobs, positionOwner }: { + check: PRCheckDetail jobs: PRCheckJob[] hasFailedJobs: boolean positionOwner?: CheckDetailsReadingOwner @@ -235,7 +253,13 @@ export function CheckRunJobs({
{visible.map(({ job, identity }) => ( - + ))}
diff --git a/src/renderer/src/components/github/pr-check-presentation.ts b/src/renderer/src/components/github/pr-check-presentation.ts index b04177a5b29..03421e52da0 100644 --- a/src/renderer/src/components/github/pr-check-presentation.ts +++ b/src/renderer/src/components/github/pr-check-presentation.ts @@ -42,6 +42,16 @@ export function getCheckStatusLabel(check: PRCheckDetail, t: Translate = transla return t('auto.components.editor.CheckRunDetailsPanel.3d9f2b8e14', 'Pending') } +export function isGitLabAllowedFailureJob(check: PRCheckDetail, job: PRCheckJob): boolean { + return ( + check.gitlabAllowedFailure === true && + check.conclusion === 'neutral' && + job.conclusion === 'neutral' && + check.gitlabJobId !== undefined && + job.id === check.gitlabJobId + ) +} + export function getCheckDetailsKey(check: PRCheckDetail): string { return String(check.checkRunId ?? check.workflowRunId ?? check.url ?? check.name) } diff --git a/src/renderer/src/components/right-sidebar/checks-panel/presentation/check-run-details.tsx b/src/renderer/src/components/right-sidebar/checks-panel/presentation/check-run-details.tsx index 1049fad1e28..a536a03d68f 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel/presentation/check-run-details.tsx +++ b/src/renderer/src/components/right-sidebar/checks-panel/presentation/check-run-details.tsx @@ -11,16 +11,17 @@ import { CheckJobLogTail } from '../logs/check-job-log-tail' import { useIntlLocale, useTranslate } from '@/i18n/use-translate' import { checkJobIdentities } from '@/components/editor/check-details/reading/check-details-reading-cache' import { resolveStepOutcome } from '../../../../../../shared/source-control/checks/pr-check-step-status' +import { + getCheckStatusLabel, + isGitLabAllowedFailureJob +} from '@/components/github/pr-check-presentation' import { type CheckDetailsLoadState, type CheckDetailsStickySurface, formatCheckTimestamp, getCheckDetailsStickySurfaceClass } from './check-details-model' -import { - getCheckConclusion, - getCheckStatusLabel -} from '../../../../../../shared/source-control/checks/pr-check-status-label' +import { getCheckConclusion } from '../../../../../../shared/source-control/checks/pr-check-status-label' function ViewFullCheckDetailsButton({ onClick, @@ -129,7 +130,7 @@ export function CheckRunDetails({
{t('auto.components.right.sidebar.checks.panel.content.a54ae21c6f', 'Status:')}{' '} - {details ? getCheckStatusLabel(detailsStatusCheck) : getCheckStatusLabel(check)} + {getCheckStatusLabel(detailsStatusCheck, t)} {startedAt && ( @@ -202,12 +203,14 @@ export function CheckRunDetails({ {job.name} - {job.conclusion ?? - job.status ?? - t( - 'auto.components.right.sidebar.checks.panel.content.ee07b33924', - 'unknown' - )} + {isGitLabAllowedFailureJob(check, job) + ? getCheckStatusLabel(check, t) + : (job.conclusion ?? + job.status ?? + t( + 'auto.components.right.sidebar.checks.panel.content.ee07b33924', + 'unknown' + ))}
{job.steps.length > 0 && (