Skip to content

Commit c74138b

Browse files
committed
more tests
1 parent 0e54fb4 commit c74138b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

cmd/server/server.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -622,14 +622,14 @@ func buildUpstreamGraph(def *enginev1.WorkflowDefinition) map[string]map[string]
622622
// wouldCreateCycle checks whether adding a new dependency edge srcStep → tgtStep
623623
// (meaning tgtStep would now consume from srcStep) would create a cycle.
624624
//
625-
// A cycle exists if srcStep is already reachable from tgtStep through the existing
626-
// upstream graph — i.e. if tgtStep is already (transitively) upstream of srcStep,
627-
// then making srcStep upstream of tgtStep closes the loop.
625+
// A cycle exists if tgtStep is already reachable from srcStep through the existing
626+
// upstream graph — i.e. if srcStep already transitively depends on tgtStep, then
627+
// making tgtStep depend on srcStep closes the loop.
628628
func wouldCreateCycle(upstream map[string]map[string]struct{}, srcStep, tgtStep string) bool {
629629
visited := map[string]bool{}
630630
var dfs func(n string) bool
631631
dfs = func(n string) bool {
632-
if n == srcStep {
632+
if n == tgtStep {
633633
return true
634634
}
635635
if visited[n] {
@@ -643,7 +643,7 @@ func wouldCreateCycle(upstream map[string]map[string]struct{}, srcStep, tgtStep
643643
}
644644
return false
645645
}
646-
return dfs(tgtStep)
646+
return dfs(srcStep)
647647
}
648648

649649
// collectWhenDeps walks a WhenExpr and calls fn for each step_id referenced.

server

11 MB
Binary file not shown.

0 commit comments

Comments
 (0)