From e0d83d1d4a5e717e63aefb9acbf0ec4660e247f6 Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 3 Jul 2026 11:38:13 +0000 Subject: [PATCH] cicd avoid noop timing fallback --- scripts/src/cicd.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/src/cicd.ts b/scripts/src/cicd.ts index 292e06f7..00971715 100644 --- a/scripts/src/cicd.ts +++ b/scripts/src/cicd.ts @@ -2150,14 +2150,17 @@ function totalTimingFromCommand(command: Record | undefined, ph function totalTimingFromStored(storedTimings: Record | null | undefined, phase?: BranchFollowerPhase): { seconds: number; status: string; source: string; startedAt: string | null; finishedAt: string | null } | null { if (storedTimings === null || storedTimings === undefined) return null; + const status = stringOrNull(storedTimings.totalStatus); + const source = stringOrNull(storedTimings.totalSource); + if (phase === "Noop" && status === "noop" && source === "tekton-pipelinerun-start") return null; const startedAt = stringOrNull(storedTimings.startedAt); const finishedAt = stringOrNull(storedTimings.finishedAt); const seconds = totalSecondsFromRange(startedAt, finishedAt) ?? numberOrNull(storedTimings.totalSeconds); if (seconds === null) return null; return { seconds, - status: finishedAt === null && phase !== undefined && !terminalPhase(phase) ? phase.toLowerCase() : stringOrNull(storedTimings.totalStatus) ?? "recorded", - source: stringOrNull(storedTimings.totalSource) ?? "stored-state", + status: finishedAt === null && phase !== undefined && !terminalPhase(phase) ? phase.toLowerCase() : status ?? "recorded", + source: source ?? "stored-state", startedAt, finishedAt, }; @@ -2165,6 +2168,7 @@ function totalTimingFromStored(storedTimings: Record | null | u function totalTimingFromLivePayload(payload: Record | null, phase?: BranchFollowerPhase): { seconds: number; status: string; source: string; startedAt: string | null; finishedAt: string | null } | null { if (payload === null) return null; + if (phase === "Noop") return null; const tekton = asOptionalRecord(payload.tekton); const startedAt = stringOrNull(tekton?.startTime); if (startedAt === null) return null;