Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Make 'flytectl compile' consider launchplans used within workflows #5437

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions flytectl/cmd/compile/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,20 @@ func compileFromPackage(packagePath string) error {
return err
}

var providers []common.InterfaceProvider
for _, plan := range plans {
providers = append(providers, compiler.NewLaunchPlanInterfaceProvider(*plan))
}

// compile workflows
for wfName, workflow := range workflows {

fmt.Println("\nCompiling workflow:", wfName)
plan := plans[wfName]

_, err := compiler.CompileWorkflow(workflow.Template,
workflow.SubWorkflows,
compiledTasks,
[]common.InterfaceProvider{compiler.NewLaunchPlanInterfaceProvider(*plan)})
providers)
if err != nil {
fmt.Println(":( Error Compiling workflow:", wfName)
return err
Expand Down
3 changes: 3 additions & 0 deletions flytectl/cmd/compile/compile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,7 @@ func TestCompilePackage(t *testing.T) {
err = compileFromPackage("testdata/invalidworkflow.tgz")
assert.NotNil(t, err, "unable to handle invalid workflow")

// testing workflows with launchplans used within workflow
err = compileFromPackage("testdata/launchplan-in-wf.tgz")
assert.Nil(t, err, "unable to compile workflow with launchplans used within workflow")
}
Binary file added flytectl/cmd/compile/testdata/launchplan-in-wf.tgz
Binary file not shown.
Loading