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

Feature Request: Importing of Pebble Macros within Workflow YAMLs #3760

Open
japerry911 opened this issue May 16, 2024 · 1 comment
Open
Labels
enhancement New feature or request
Milestone

Comments

@japerry911
Copy link

Feature description

I reuse Pebble expressions all over my Workflow YAMLs, and could benefit from making them macros in a single file, and importing them to Workflow YAMLs.

If this is possible, this is a nice-to-have, it is not blocking anything.

Related Docs:

Kestra Macro

Pebble Import statement that might be relevant

Thank you 🙏

@japerry911 japerry911 added the enhancement New feature or request label May 16, 2024
@anna-geller
Copy link
Member

Asked the team to validate whether storing macros on a namespace level would be feasible:

resource "kestra_namespace" "example" {
  namespace_id  = "io.kestra.mynamespace"
  description   = "Friendly description"
  variables     = <<EOT
k1: 1
k2:
    v1: 1
EOT
  task_defaults = <<EOT
- type: io.kestra.core.tasks.log.Log
  values:
    message: first {{flow.id}}
- type: io.kestra.core.tasks.debugs.Return
  values:
    format: first {{flow.id}}
EOT
  macros = <<EOT
{% macro input(type, name) %}
    <input type="{{ type }}" name="{{ name }}" />
{% endmacro %}
{% macro my_macro(column, table) %}
    SELECT {{ column }}
    FROM {{ table }}
{% endmacro %}
EOT
}

in OSS, this would need to be defined in the configuration the same way as for taskDefaults

@anna-geller anna-geller added this to the v0.18.0 milestone May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants