From e9694644bce534992f370993b9285e279f44f203 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Fri, 31 Jul 2026 12:35:36 -0400 Subject: [PATCH] Fix canceled parallel stage duration --- .../stage-renderers/parallel-children.test.tsx | 14 ++++++++++++++ .../stage-renderers/parallel-children.tsx | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/apps/fabro-web/app/components/stage-renderers/parallel-children.test.tsx b/apps/fabro-web/app/components/stage-renderers/parallel-children.test.tsx index 0800fddb0..4354d7fb6 100644 --- a/apps/fabro-web/app/components/stage-renderers/parallel-children.test.tsx +++ b/apps/fabro-web/app/components/stage-renderers/parallel-children.test.tsx @@ -144,6 +144,20 @@ describe("ParallelChildren", () => { expect(statValue(renderer, "Failed")).toBe("0"); }); + test("uses the stage duration when cancellation interrupts the parallel summary", () => { + const renderer = renderParallel( + [startedEvent(2)], + [], + { + ...parallelStage, + status: StageState.CANCELLED, + duration: "53m 29s", + }, + ); + + expect(statValue(renderer, "Duration")).toBe("53m 29s"); + }); + test("keeps looped fork links scoped to the selected fork visit", () => { const renderer = renderParallel( [startedEvent(1)], diff --git a/apps/fabro-web/app/components/stage-renderers/parallel-children.tsx b/apps/fabro-web/app/components/stage-renderers/parallel-children.tsx index 21c7c9271..02f939d30 100644 --- a/apps/fabro-web/app/components/stage-renderers/parallel-children.tsx +++ b/apps/fabro-web/app/components/stage-renderers/parallel-children.tsx @@ -5,7 +5,12 @@ import { StageState } from "@qltysh/fabro-api-client"; import type { EventEnvelope } from "@qltysh/fabro-api-client"; import type { Stage } from "../stage-sidebar"; -import { formatStageLabel, stageStatusLabel, stageStatusTone } from "../../lib/stage-sidebar"; +import { + ACTIVE_STAGE_STATES, + formatStageLabel, + stageStatusLabel, + stageStatusTone, +} from "../../lib/stage-sidebar"; import { formatDurationMs } from "../../lib/format"; import { StageMetaBar } from "./meta-bar"; import { parseParallelOverview } from "./helpers"; @@ -182,6 +187,13 @@ export function ParallelChildren({ else if (row.status === StageState.FAILED) failureCount += 1; } + let duration = stage.duration === "--" ? "—" : stage.duration; + if (overview.durationMs != null) { + duration = formatDurationMs(overview.durationMs); + } else if (ACTIVE_STAGE_STATES.has(stage.status)) { + duration = "running"; + } + return (
@@ -200,7 +212,7 @@ export function ParallelChildren({ />