turbot / flowpipe

Flowpipe is a cloud scripting engine. Automation and workflow to connect your clouds to the people, systems and data that matters.
https://flowpipe.io
GNU Affero General Public License v3.0
383 stars 16 forks source link

prompt for missing vars on server startup #136

Closed johnsmyth closed 11 months ago

johnsmyth commented 1 year ago

When variables have no value, flowpipe fails to start. We should instead prompt for the missing variables unless the user start with --input=false. This is consistent with steampipe and terraform.

cbruno10 commented 1 year ago

If --input=false and we fail, the error message could use some cleanup:

cbruno@M1P gitlab % flowpipe service start
panic: missing 1 variable value:
    access_token not set

goroutine 1 [running]:
github.com/turbot/flowpipe/pipeparser/error_helpers.FailOnError({0x1045caf20, 0x140006682a0})
    /home/runner/work/flowpipe/flowpipe/flowpipe/pipeparser/error_helpers/utils.go:33 +0x54
github.com/turbot/flowpipe/internal/cmd/service.ServiceStartCmd.startManagerFunc.func1(0x1400095a600?, {0x10531ac00?, 0x4?, 0x103cba05d?})
    /home/runner/work/flowpipe/flowpipe/flowpipe/internal/cmd/service/start.go:71 +0x98
github.com/spf13/cobra.(*Command).execute(0x14000736300, {0x10531ac00, 0x0, 0x0})
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:944 +0x640
github.com/spf13/cobra.(*Command).ExecuteC(0x1400003d800)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x320
github.com/spf13/cobra.(*Command).Execute(...)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
github.com/turbot/flowpipe/internal/cmd.RunCLI({0x1045e0ff8?, 0x1400021d9e0?})
    /home/runner/work/flowpipe/flowpipe/flowpipe/internal/cmd/cmd.go:14 +0x2c
main.main()
    /home/runner/work/flowpipe/flowpipe/flowpipe/main.go:38 +0x248
vhadianto commented 11 months ago

This is now done