Closed benjamin-bergia closed 1 month ago
The tricky thing about that is it's quite common for the rules in a kargo-render.yaml
file to match many branches using a regex instead of matching explicitly named branches. The involvement of regexes makes the concept of "all branches" rather nebulous.
I see. I don't use regex at all in my configs so that's probably why I felt it was kind of redundant.
An alternative might be to all regex in the action config. This way people could have a targetBranch
like env/*-test
for example.
Doesn't env/*-test match an infinite number of branches?
Not sure what you mean. Do you mean in the sense my example is wrong or in the sense that targetBranch would always match?
What I meant is: If you specified a target branch of env/*-test
doesn't that match an infinite number of branches? It matches:
env/a-test
env/b-test
env/supercalifragilisticexpialidocious-test
env/zzz-test
Oh I might be understanding the targetBranch
input of the action wrong.
I thought targetBranch
was a sort of filter applied on the result of running kargo-render on the kargo-render.yaml
file.
But from your comment it looks like targetBranch
is passed to kargo-render to tell it which branch to render.
In this case it might make more sense to user regex in my kargo-render.yaml
and only specify branches with targetBranch
.
But from your comment it looks like targetBranch is passed to kargo-render to tell it which branch to render.
Yes. This is correct. It's: "Please prepare kargo-render.yaml
."
In this case it might make more sense to user regex in my kargo-render.yaml and only specify branches with targetBranch.
Also yes. That would be the common thing -- keep your kargo-render.yaml
nice and DRY by specifying one set of rules that will match any env/*
. Either the Action or Kargo proper tells Kargo Render what branch(es) to prepare.
Would it be possible for the action command to render all the branches in the
kargo-render.yaml
file by default. And iftargetBranch
is provided only then limit itself to these branches?In most of our repository we end up rendering everything when there is a change and having to always update the github workflow to add a branch that I just added in my
kargo-render.yaml
is not very convenient.