Skip to content

Commit

Permalink
update pipeline task topo
Browse files Browse the repository at this point in the history
  • Loading branch information
Gkrumbach07 committed Dec 19, 2024
1 parent 14b1c4d commit f6597e8
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,18 @@ const getNodesForTasks = (
// Read the artifact-task map we built before
// Add edge from artifact to task
const artifactToTaskEdges = taskArtifactMap[taskId]?.map((v) => v.artifactNodeId) ?? [];
runAfter.push(...artifactToTaskEdges);

// Filter out direct runAfter edges if there's an artifact connection
const artifactConnectedTasks = new Set(
artifactToTaskEdges.flatMap((artifactId) => {
const [, sourceTaskId] = artifactId.split('-');
return sourceTaskId || [];
}),
);

const filteredRunAfter = runAfter.filter(
(sourceTaskId) => !artifactConnectedTasks.has(sourceTaskId),
);

if (hasSubTask && subTasks) {
const subTasksArtifactMap = parseTasksForArtifactRelationship(taskId, subTasks);
Expand All @@ -227,13 +238,13 @@ const getNodesForTasks = (
taskId,
taskName,
pipelineTask,
runAfter,
filteredRunAfter,
runStatus,
taskChildren,
);
nodes.push(itemNode, ...nestedNodes);
} else {
nodes.push(createNode(taskId, taskName, pipelineTask, runAfter, runStatus));
nodes.push(createNode(taskId, taskName, pipelineTask, filteredRunAfter, runStatus));
}
children.push(taskId);
});
Expand Down

0 comments on commit f6597e8

Please sign in to comment.