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

Only run trigger on the top level mod #69

Closed vhadianto closed 9 months ago

github-actions[bot] commented 9 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

vhadianto commented 9 months ago

@graza-io - same comment with #59

graza-io commented 9 months ago

This seems to already be the case; I have verified this by creating a child mod with http & schedule triggers then loading the top-level mod into a running server

I can see both pipelines in pipeline list

❯ go run . pipeline list --host local
MOD      NAME                DESCRIPTION
mod.a    a.pipeline.hi
mod.b    b.pipeline.hello

trigger list only shows output for the http trigger in top level mod:

❯ go run . trigger list --host local
NAME                             TYPE    PIPELINE         DESCRIPTION    URL                                                                                                                SCHEDULE
a.trigger.http.a_http_trigger    http    a.pipeline.hi                   /api/latest/hook/a.trigger.http.a_http_trigger/7853dc3599528cd14c067be32f85ca85a1463f43b513a8b9e9db698db23db974

Neither the http nor schedule trigger seem to be actionable:

❯ cat ~/src/mods/flowpipe-mod-a/.flowpipe/mods/b@v0.0.1/mod.fp
mod "b" {
  title = "flowpipe-mod-b"
}

pipeline "hello" {
  step "transform" "echo" {
    value = "HELLO FROM B"
  }

  output "b_out" {
    value = step.transform.echo.value
  }
}

trigger "schedule" "b_time_trigger" {
  schedule = "* * * * *"
  pipeline = pipeline.hello
}

trigger "http" "b_http_trigger" {
  pipeline = pipeline.hello
}
graza-io commented 9 months ago

Verified stepping through debug of server only seems to load triggers into manager for top-level mod.