From 2e11cb4541459bcdb9f38702428285043130aed3 Mon Sep 17 00:00:00 2001 From: Jared O'Connell Date: Thu, 19 Sep 2024 16:23:14 -0400 Subject: [PATCH] Addressed review comments --- workflow/executor.go | 5 ++--- workflow/yaml_test.go | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) 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))