Skip to content

Commit 11d956c

Browse files
mr-remingtontimja
andauthored
Fix potential state mismatch in graph overview (#590)
Co-authored-by: Tim Jacomb <timjacomb1@gmail.com>
1 parent 425c38e commit 11d956c

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/main/frontend/pipeline-graph-view/pipeline-graph/main/PipelineGraph.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
StageInfo,
1111
} from "./PipelineGraphModel";
1212
import { layoutGraph } from "./PipelineGraphLayout";
13-
13+
import { Result } from "./PipelineGraphModel";
1414
import { Node, SelectionHighlight } from "./support/nodes";
1515
import {
1616
BigLabel,
@@ -162,8 +162,25 @@ export class PipelineGraph extends React.Component {
162162

163163
let nodes = [];
164164
for (const column of nodeColumns) {
165+
const topStageState = column.topStage?.state ?? Result.unknown;
166+
165167
for (const row of column.rows) {
166168
for (const node of row) {
169+
// If the topStage is still running but one of its child nodes has completed,
170+
// the UI may incorrectly display the childs status instead of the topStages.
171+
// To ensure consistency, override the nodes state with the topStages state.
172+
// This issue is reproducible in the complexSmokes test.
173+
if (
174+
column.topStage &&
175+
"stage" in node &&
176+
node.stage &&
177+
Array.isArray(column.topStage.children) &&
178+
column.topStage.children.includes(node.stage) &&
179+
this.props.collapsed
180+
) {
181+
node.stage.state = topStageState;
182+
}
183+
167184
nodes.push(node);
168185
}
169186
}

0 commit comments

Comments
 (0)