Skip to content

Commit 9404e61

Browse files
committed
feat: add FAILED_WORKFLOW_STAGE_STATUS_MAP for improved workflow status handling
1 parent 587456a commit 9404e61

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

src/Shared/Components/CICDHistory/TriggerOutput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ import {
6969
PROGRESSING_STATUS,
7070
WORKFLOW_STAGE_STATUS_TO_TEXT_MAP,
7171
EXECUTION_FINISHED_TEXT_MAP,
72+
FAILED_WORKFLOW_STAGE_STATUS_MAP,
7273
} from './constants'
7374
import { GitTriggers } from '../../types'
7475
import LogsRenderer from './LogsRenderer'
@@ -79,7 +80,6 @@ import Artifacts from './Artifacts'
7980
import { DeploymentStageType, EMPTY_STATE_STATUS } from '../../constants'
8081
import { ConfirmationModal, ConfirmationModalVariantType } from '../ConfirmationModal'
8182
import {
82-
FAILED_WORKFLOW_STAGE_STATUS_MAP,
8383
getFormattedTriggerTime,
8484
getIconFromWorkflowStageStatusType,
8585
getWorkerPodBaseUrl,

src/Shared/Components/CICDHistory/constants.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,15 @@ export const PROGRESSING_STATUS = {
149149
[TERMINAL_STATUS_MAP.INITIATING]: 'initiating',
150150
[TERMINAL_STATUS_MAP.QUEUED]: 'queued',
151151
}
152+
153+
export const FAILED_WORKFLOW_STAGE_STATUS_MAP: Record<
154+
Extract<
155+
WorkflowStageStatusType,
156+
WorkflowStageStatusType.ABORTED | WorkflowStageStatusType.FAILED | WorkflowStageStatusType.TIMEOUT
157+
>,
158+
true
159+
> = {
160+
[WorkflowStageStatusType.ABORTED]: true,
161+
[WorkflowStageStatusType.FAILED]: true,
162+
[WorkflowStageStatusType.TIMEOUT]: true,
163+
}

src/Shared/Components/CICDHistory/utils.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { ReactComponent as ICHelpFilled } from '@Icons/ic-help-filled.svg'
3131
import { ReactComponent as ICWarningY5 } from '@Icons/ic-warning-y5.svg'
3232
import { isTimeStringAvailable } from '@Shared/Helpers'
3333
import { DATE_TIME_FORMATS } from '@Common/Constants'
34-
import { DEFAULT_CLUSTER_ID, TERMINAL_STATUS_MAP } from './constants'
34+
import { DEFAULT_CLUSTER_ID, FAILED_WORKFLOW_STAGE_STATUS_MAP, TERMINAL_STATUS_MAP } from './constants'
3535
import { ResourceKindType, WorkflowStatusEnum } from '../../types'
3636
import {
3737
TriggerHistoryFilterCriteriaProps,
@@ -47,18 +47,6 @@ import {
4747
WorkflowExecutionStageNameType,
4848
} from './types'
4949

50-
export const FAILED_WORKFLOW_STAGE_STATUS_MAP: Record<
51-
Extract<
52-
WorkflowStageStatusType,
53-
WorkflowStageStatusType.ABORTED | WorkflowStageStatusType.FAILED | WorkflowStageStatusType.TIMEOUT
54-
>,
55-
true
56-
> = {
57-
[WorkflowStageStatusType.ABORTED]: true,
58-
[WorkflowStageStatusType.FAILED]: true,
59-
[WorkflowStageStatusType.TIMEOUT]: true,
60-
}
61-
6250
export const getTriggerHistoryFilterCriteria = ({
6351
appId,
6452
envId,

src/Shared/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,9 @@ export interface TargetPlatformsDTO {
938938
targetPlatforms: TargetPlatformItemDTO[]
939939
}
940940

941+
/**
942+
* These status are expected to be present in workflow nodes like ci node, linked ci node, job overview, etc.
943+
*/
941944
export enum WorkflowStatusEnum {
942945
STARTING = 'Starting',
943946
RUNNING = 'Running',

0 commit comments

Comments
 (0)