Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update pipeline task topo #3601

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,25 @@ 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);

// Find tasks that are connected through artifacts to the current task
const artifactConnectedTasks = new Set(
artifactToTaskEdges.flatMap((artifactId) => {
const parts = artifactId.split('.');
return parts.length >= 4 ? parts[3] : [];
}),
);

// Filter out direct runAfter edges if there's an artifact connection
const filteredRunAfter = runAfter.filter((sourceId) => {
if (!sourceId.includes('.')) {
return !artifactConnectedTasks.has(sourceId);
}
return true;
});

if (hasSubTask && subTasks) {
const subTasksArtifactMap = parseTasksForArtifactRelationship(taskId, subTasks);

Expand All @@ -227,13 +242,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
Loading