Skip to content

Commit

Permalink
feat: display failure node in workflow graph
Browse files Browse the repository at this point in the history
Signed-off-by: Lyon Lu <lyonlu13@gmail.com>
  • Loading branch information
lyonlu13 committed Feb 23, 2024
1 parent a162fb0 commit f89be26
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,28 @@ const parseWorkflow = (
};
}

/* Build failure node and add downstream connection for edges building */
const failureNode = context.template.failureNode;
if (failureNode && failureNode.id) {
parseNode({

Check warning on line 498 in packages/console/src/components/WorkflowGraph/transformerWorkflowToDag.tsx

View check run for this annotation

Codecov / codecov/patch

packages/console/src/components/WorkflowGraph/transformerWorkflowToDag.tsx#L498

Added line #L498 was not covered by tests
node: failureNode as CompiledNode,
root: root,
dynamicToMerge,
nodeExecutionsById,
staticExecutionIdsMap,
workflow,
});
nodeMap[failureNode.id] = {

Check warning on line 506 in packages/console/src/components/WorkflowGraph/transformerWorkflowToDag.tsx

View check run for this annotation

Codecov / codecov/patch

packages/console/src/components/WorkflowGraph/transformerWorkflowToDag.tsx#L506

Added line #L506 was not covered by tests
dNode: root.nodes[root.nodes.length - 1],
compiledNode: failureNode as CompiledNode,
};
if (

Check warning on line 510 in packages/console/src/components/WorkflowGraph/transformerWorkflowToDag.tsx

View check run for this annotation

Codecov / codecov/patch

packages/console/src/components/WorkflowGraph/transformerWorkflowToDag.tsx#L510

Added line #L510 was not covered by tests
!context.connections.downstream[startNodeId].ids.includes(failureNode.id)
) {
context.connections.downstream[startNodeId].ids.push(failureNode.id);

Check warning on line 513 in packages/console/src/components/WorkflowGraph/transformerWorkflowToDag.tsx

View check run for this annotation

Codecov / codecov/patch

packages/console/src/components/WorkflowGraph/transformerWorkflowToDag.tsx#L513

Added line #L513 was not covered by tests
}
}

/* Build Edges */
buildWorkflowEdges(root, context.connections, startNodeId, nodeMap);
return root;
Expand Down

0 comments on commit f89be26

Please sign in to comment.