-
-
Notifications
You must be signed in to change notification settings - Fork 380
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
Force agent labels to be set on pipelines as well #3483
Conversation
Wouldn't this be a breaking change? |
Yes it would. We can still decide to introduce another config option but as said in the issue the current behavior doesnt make sense to me. |
Yes, I agree to you, but then I think we should either make it non-breaking or wait for next major. Maybe we can keep the current behavior and log a deprecation warning if a label is missing? |
What's the best way to make it none-breaking? What I tried is to add a flag |
Adding a new config var is one option, you could also just add a deprecation for now and change it in next major. |
I thought about it again and to might be helpful for some use cases to keep the current behavior but make it configurable. @anbraten can you guide me a bit with the gRPC part? |
To simplify it we could even make this a server setting (so no adjustments to grpc etc are needed) and change it to the new way with the next major. As the agent sets some labels by default, |
@xoxys Now with 3.0 next, we could merge this I think? |
Sure we could, I still think this should be better configurable but open for other decisions. |
this is not easy as the labels are currently used to let agents "advertice capabilitys/propertys" the pipelines can target. so make them mandatory by default will break all existing pipelines and add unnecessary complexytiy to the config. to make an label required should be optional! I think we could either add some prefix like |
ontop of #4141: ### `WOODPECKER_AGENT_LABELS`
> Default: empty
Configures custom labels for the agent, to let workflows filter by it.
Use a list of key-value pairs like `key=value,second-key=*`. `*` can be used as a wildcard.
+If you use `!` as key prefix it is mandatory for the workflow to have that label set (without !) set and matched.
By default, agents provide three additional labels `platform=os/arch`, `hostname=my-agent` and `repo=*` which can be overwritten if needed.
To learn how labels work, check out the [pipeline syntax page](../20-usage/20-workflow-syntax.md#labels). |
Fixes: #2634