-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Daisy: Recursively build child workflows in NewFromFile when path doe…
…sn't have variable. (#1701) This adds support for recursively reading child workflows. The feature was first added in #1693, but rolled back in #1700 due to a bug that it introduced. The issue: Variable instantiate occurs during populate, and callers expect that behavior. Callers also expect to define child workflow names using variables. Those are in conflict if we want to read child workflows before populate. To address this, I added a fix in eacb97a where child workflows are eagerly read only when they're fully specified. If the filename contains a variable, then the legacy behavior of reading the workflow during the step's populate is retained.
- Loading branch information
Showing
18 changed files
with
383 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
daisy/test_data/TestNewFromFile_ReadsChildWorkflows.child1.wf.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"steps": { | ||
"include-workflow": { | ||
"IncludeWorkflow": { | ||
"path": "./TestNewFromFile_ReadsChildWorkflows.child2.wf.json", | ||
"Vars": { | ||
"k3": "v3" | ||
} | ||
} | ||
}, | ||
"sub-workflow": { | ||
"SubWorkflow": { | ||
"path": "./TestNewFromFile_ReadsChildWorkflows.child2.wf.json", | ||
"Vars": { | ||
"k4": "v4" | ||
} | ||
} | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
daisy/test_data/TestNewFromFile_ReadsChildWorkflows.child2.wf.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"steps": { | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
daisy/test_data/TestNewFromFile_ReadsChildWorkflows.parent.wf.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"steps": { | ||
"include-workflow": { | ||
"IncludeWorkflow": { | ||
"path": "./TestNewFromFile_ReadsChildWorkflows.child1.wf.json", | ||
"Vars": { | ||
"k1": "v1" | ||
} | ||
} | ||
}, | ||
"sub-workflow": { | ||
"SubWorkflow": { | ||
"path": "./TestNewFromFile_ReadsChildWorkflows.child1.wf.json", | ||
"Vars": { | ||
"k2": "v2" | ||
} | ||
} | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
daisy/test_data/TestNewFromFile_SupportsNestedVariables.child.wf.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"Vars": { | ||
"k1": { | ||
"Required": true, | ||
"Description": "The Ubuntu release to translate." | ||
} | ||
}, | ||
"steps": { | ||
"create-disks": { | ||
"createDisks": [ | ||
{ | ||
"SourceImage": "image-${k1}", | ||
"SizeGb": "50", | ||
"Type": "pd-ssd" | ||
} | ||
] | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
daisy/test_data/TestNewFromFile_SupportsNestedVariables.parent.wf.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"vars": { | ||
"var_name_is_variable": { | ||
"Value": "k1" | ||
}, | ||
"var_value_is_variable": { | ||
"Value": "v1" | ||
} | ||
}, | ||
"steps": { | ||
"include-workflow": { | ||
"IncludeWorkflow": { | ||
"path": "./TestNewFromFile_SupportsNestedVariables.child.wf.json", | ||
"Vars": { | ||
"${var_name_is_variable}": "${var_value_is_variable}" | ||
} | ||
} | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
daisy/test_data/TestNewFromFile_SupportsNestedVariables_VarInFilename.child.wf.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"Vars": { | ||
"k1": { | ||
"Required": true, | ||
"Description": "The Ubuntu release to translate." | ||
} | ||
}, | ||
"steps": { | ||
"create-disks": { | ||
"createDisks": [ | ||
{ | ||
"SourceImage": "image-${k1}", | ||
"SizeGb": "50", | ||
"Type": "pd-ssd" | ||
} | ||
] | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
daisy/test_data/TestNewFromFile_SupportsNestedVariables_VarInFilename.parent.wf.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"vars": { | ||
"filename_is_variable": { | ||
"Value": "TestNewFromFile_SupportsNestedVariables_VarInFilename.child.wf.json" | ||
}, | ||
"var_name_is_variable": { | ||
"Value": "k1" | ||
}, | ||
"var_value_is_variable": { | ||
"Value": "v1" | ||
} | ||
}, | ||
"steps": { | ||
"include-workflow": { | ||
"IncludeWorkflow": { | ||
"path": "${filename_is_variable}", | ||
"Vars": { | ||
"${var_name_is_variable}": "${var_value_is_variable}" | ||
} | ||
} | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
daisy/test_data/TestNewIncludedWorkflowFromFile_UsesResourcesFromParent.wf.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"steps": { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.