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
361 stars 13 forks source link

[cli-flag] flowpipe pipeline list --output yaml throws error #356

Closed vkumbha closed 9 months ago

vkumbha commented 10 months ago

cli version: Flowpipe v0.1.0-beta.202312010239

flowpipe pipeline list --output yaml throws below error

$ flowpipe pipeline list --output yaml
Error: reflect.Value.Interface: cannot return value obtained from unexported field or method

The outputs json and table work but yaml throws an error.

json:

$ flowpipe pipeline list --output json
[
  {
    "description": "Get geolocation data for an IPv4 or IPv6 address.",
    "mod": "mod.reallyfreegeoip",
    "name": "reallyfreegeoip.pipeline.get_ip_geolocation",
    "outputs": [
      {
        "depends_on": [
          "http.get_ip_geolocation"
        ],
        "description": "IP geolocation details.",
        "name": "geolocation"
      }
    ],
    "params": [
      {
        "default": {},
        "description": "The IPv4 or IPv6 address.",
        "name": "ip_address",
        "optional": false,
        "type": "string"
      },
      {
        "default": {
          "format": "json"
        },
        "description": "The format of the output. Accepted values are json, csv and xml. Defaults to json.",
        "name": "format",
        "optional": true,
        "type": "string"
      }
    ],
    "steps": [
      {
        "method": "get",
        "name": "get_ip_geolocation",
        "pipeline_name": "reallyfreegeoip.pipeline.get_ip_geolocation",
        "step_type": "http",
        "url": null
      }
    ],
    "title": "Get IP Geolocation"
  }
]

table

$ flowpipe pipeline list --output table
MOD                    NAME                                           DESCRIPTION
mod.reallyfreegeoip    reallyfreegeoip.pipeline.get_ip_geolocation    Get geolocation data for an IPv4 or IPv6 address.
graza-io commented 10 months ago

@vkumbha I believe this was resolved in commit https://github.com/turbot/flowpipe/commit/fed7a5ddfa207f1625115636813d24dea3afc23d - can you retest on a more recent build if you still experience these issues?

vkumbha commented 10 months ago

@graza-io I can confirm this is working in Flowpipe v0.1.0-beta.202312041337. Closing the issue, Thank you!

vkumbha commented 10 months ago

@graza-io I face an error with this again. Below is my pipeline, if you try for the below pipeline it fails with the error. If you uncomment the documentation = file("./docs/index.md") it works fine.

$ flowpipe pipeline list --output yaml
Error: Error when printing - [1:2] unterminated flow mapping
>  1 | [{"name":"local.pipeline.get_astronauts","description":"Get astronauts in space right now.","mod":"mod.local","title":"Get Astronauts","documentation":
        ^
pipeline "get_astronauts" {
  title         = "Get Astronauts"
  description   = "Get astronauts in space right now."
  documentation = file("./docs/index.md")

  param "url" {
    type    = string
    default = "http://api.open-notify.org/astros"
  }

  step "http" "whos_in_space" {
    url    = param.url
    method = "get"
  }

  output "people_in_space" {
    description = "List of people in space right now."
    value       = step.http.whos_in_space.response_body.people[*].name
    sensitive   = true
  }
}
vkumbha commented 9 months ago

Works fine on latest version Flowpipe v0.1.0-beta.202312061547. Thanks for fixing it!