Skip to content

Commit

Permalink
fix(frontend): Fix logic deciding if a node was cached. Fixes #4814
Browse files Browse the repository at this point in the history
The UI was deciding whether a node was cached based on whether it was
pointing to some other node's output artifacts.

This works for nodes that correspond to pods, but leads to a wrong
decision for the rest of the nodes. For example, if the node is a Retry
one, it points to another node's outputs because it is that other node
that actually produced them.

We now apply this logic on pod-type nodes only.

Fixes #4814

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>
  • Loading branch information
elikatsis committed Nov 23, 2020
1 parent ab21ec9 commit 9937bd4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions frontend/src/lib/StatusUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,11 @@ export function parseNodePhase(node: NodeStatus): NodePhase {

function wasNodeCached(node: NodeStatus): boolean {
const artifacts = node.outputs?.artifacts;
if (!artifacts || !node.id) {
return false;
}
// HACK: There is a way to detect the skipped pods based on the WorkflowStatus alone.
// All output artifacts have the pod name (same as node ID) in the URI. But for skipped
// pods, the pod name does not match the URIs.
// (And now there are always some output artifacts since we've enabled log archiving).
return artifacts.some(artifact => artifact.s3 && !artifact.s3.key.includes(node.id));
return !artifacts || !node.id || node.type !== 'Pod'
? false
: artifacts.some(artifact => artifact.s3 && !artifact.s3.key.includes(node.id));
}

0 comments on commit 9937bd4

Please sign in to comment.