diff --git a/workflow/executor.go b/workflow/executor.go index bca266c..e0c4d6b 100644 --- a/workflow/executor.go +++ b/workflow/executor.go @@ -1044,9 +1044,8 @@ func (e *executor) prepareOptionalExprDependencies( dependencyType = dgraph.OptionalDependency } - // The way that this will work is the current node will depend on the grouped - // node to isolate the optional dependencies. The current node will depend on it - // with either optional or completion dependencies + // Creates a new group node to isolate the optional dependencies. + // The current node will depend on the group node with the dependency type set in `dependencyType`. optionalDagNode, err := e.createGroupNode(currentNode, pathInCurrentNode, dag, dependencyType) if err != nil { return err diff --git a/workflow/yaml_test.go b/workflow/yaml_test.go index 2db2824..2c9d028 100644 --- a/workflow/yaml_test.go +++ b/workflow/yaml_test.go @@ -195,7 +195,8 @@ func TestBuildWaitOptionalExpr_InvalidExpr(t *testing.T) { } func TestBuildWaitOptionalExpr_InvalidTag(t *testing.T) { - // It should never get there outside the unit test. + // This code tests an invalid tag used with buildOptionalExpressions that + // should not be possible in production code due to other checks. yamlInput := []byte(`!invalid some_expr`) input := assert.NoErrorR[yaml.Node](t)(yaml.New().Parse(yamlInput)) _, err := buildOptionalExpression(input, make([]string, 0))