refactor(core): Unify failed and error execution status (no-changelog) (#8943)

This commit is contained in:
Iván Ovejero
2024-03-25 17:52:07 +01:00
committed by GitHub
parent 1fb0dd4f1c
commit 69807a5efb
20 changed files with 36 additions and 26 deletions

View File

@@ -10,13 +10,13 @@ import { Logger } from '@/Logger';
export function determineFinalExecutionStatus(runData: IRun): ExecutionStatus {
const workflowHasCrashed = runData.status === 'crashed';
const workflowWasCanceled = runData.status === 'canceled';
const workflowHasFailed = runData.status === 'failed';
const workflowHasFailed = runData.status === 'error';
const workflowDidSucceed =
!runData.data.resultData?.error &&
!workflowHasCrashed &&
!workflowWasCanceled &&
!workflowHasFailed;
let workflowStatusFinal: ExecutionStatus = workflowDidSucceed ? 'success' : 'failed';
let workflowStatusFinal: ExecutionStatus = workflowDidSucceed ? 'success' : 'error';
if (workflowHasCrashed) workflowStatusFinal = 'crashed';
if (workflowWasCanceled) workflowStatusFinal = 'canceled';
if (runData.waitTill) workflowStatusFinal = 'waiting';