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

When a variable is defined but no value is set, the pipeline run should prompt for value #413

Closed vkumbha closed 11 months ago

vkumbha commented 11 months ago

As per the doc, https://flowpipe-io-git-main-turbot.vercel.app/docs/mods/mod-variables#passing-input-variables

If you run Flowpipe from a mod that defines input variables, and they are not set anywhere (no default, not set in a .fpvars file, not set with --var argument, not set via environment variable) then Flowpipe will prompt you for them before running the control/benchmark.

When no inputs are passed and when we run flowpipe server, flowpipe prompts for variable input but the same throws an error for flowpipe pipeline run <pipeline>. This should behave same as the prior and prompt for variable value.

Asking for variable here

$ flowpipe server

Variables defined with no value set.
var.url
  The URL to get the astronauts from.

  Enter a value: http://api.open-notify.org/astros

Throwing an error here.

$ flowpipe pipeline run get_astronauts
Error: missing 1 variable value:
    url not set

Here is my pipeline:

variable "url" {
  type        = string
  description = "The URL to get the astronauts from."
}

pipeline "get_astronauts" {
  step "http" "whos_in_space" {
    url    = var.url
    method = "get"
  }

  output "people" {
    value = step.http.whos_in_space.response_body.people
  }
}
kaidaguerre commented 11 months ago

@vkumbha I can't reproduce:

flowpipe pipeline run get_astronauts

Variables defined with no value set.
var.url
  The URL to get the astronauts from.

  Enter a value:
vhadianto commented 11 months ago

This still happens to me @kaidaguerre :

go run . pipeline run jsonplaceholder_expr --mod-location ./internal/es/estest/test_suite_mod/
Error: missing 1 variable value:
        var_from_env not set