-
-
Notifications
You must be signed in to change notification settings - Fork 378
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
filters
/ Labels
are not very well documented.
#304
Comments
@reivilibre Do you mean the |
my apologies, I hit enter in the title bar and sent it without a body :(. I added some details now |
We just released some new docs with #282 two days ago and there are still some points missing / outdated. Would be super cool if you could create a PR and document some of the points you found out. Maybe a new page called |
In the agent's flags, there seems to be the ability to specify some filters:
woodpecker/cmd/drone-agent/flags.go
Lines 67 to 71 in a07f120
It says we can restrict builds by label — perfect, but it's not clear what those labels are or what the filters look like.
I've been digging through the code a little bit, and it turns out that:
1: this has examples of the filter syntax: https://github.com/woodpecker-ci/expr/blob/164b8b3d0915b31a990c04f93e20928ed67a45fb/selector_test.go#L11
2: the below defines the 'filter function' — one thing I notice is that it seems to be that if you specify a filter, you MUST manually specify
platform == ...
in that filter otherwise you won't be filtering by platform anymore (The 'platform' is special-cased into thefilter.Labels
map at some point leading up to here, but I've lost track)woodpecker/server/rpc.go
Lines 494 to 518 in a07f120
3: this below is where the labels are attached to the Task
https://github.com/woodpecker-ci/woodpecker/blob/master/server/hook.go#L390-L395
4: it seems like this might be specifiable as a
labels
map in the pipeline YAML, but that part is not entirely clear to me — seems to belibcompose.SliceorMap
.Point (2) seems like a bug to me — surely you shouldn't be able to bypass the platform filter.
But in any case, none of this seems documented (please point it out if it is :)) and it'd be nice to change that (I'm happy to do so, just wanted to know if I'm missing anything / not understanding properly).
The text was updated successfully, but these errors were encountered: