Panfactum / stack

The Panfactum Stack
https://panfactum.com
Other
16 stars 5 forks source link

[feature]: wf_spec add labelsFrom default to include parameters so they are searcheable #169

Open wesbragagt opened 1 month ago

wesbragagt commented 1 month ago

Prior Search

What new functionality would you like to see?

In our stack it became critical to be able to identify workflows that triggered with certain parameters. In the current setup it is not possible to pass parameters as labels so they can be searched. I found in the Argo repository examples and I was able to add to our stack by merging the wf_spec workflowMetadata in the manifest section.

After that I can query for workflows that triggered with a brandId= for example:

image

How would you use this new functionality?

I would love to have either a default in the wf_spec module where it spreads all the parameters as labelsFrom. Here is an example of what I had to do:

          workflowMetadata = merge(module.workflows[key].workflow_spec.workflowMetadata, {
            # Allows us to query for input values in the Argo UI
            labelsFrom = {
              for k, v in value.parameters : v.name => {
                expression = "workflow.parameters.${v.name}"
              }
            }
          })
fullykubed commented 1 month ago

This is a good idea. Will add it to the next release.

wesbragagt commented 1 month ago

@fullykubed one important call out is potentially having a flag to make a parameter not searchable for instances when you have an input that is a large JSON string. I think a user should be able to turn that off for that particular parameter.