-
-
Notifications
You must be signed in to change notification settings - Fork 371
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
RFC: How to add new pipeline events without needing to ignore them each time #1451
Comments
A global Either explicitly specify or take all current and future events. Basically, when using wildcards or not filtering at all, I'd expect that as the default behavior THB. Also, since some discussions on the Pipeline structure are still open (IIRC), are we currently completely non-breaking or should the new format get a version attribute anyway, which would then let us handle events based on config version (I believe once new keywords are added versioning will somewhat need to enter the picture anyway). |
I am totally with you on that point. Already got kicked by that default filter for crons a few times 🙈 We are trying to keep the config changes as minimal as possible, but if it is a needed change we would break things before releasing There was the idea to have a completely separated code unit for the config compiling which would allow to add config version, but honestly that's pretty complicated and would probably require quite some effort to support old compilers in the long term. |
Jep, that would be some effort, what I would take into consideration would be to have the version in the file at least from 1.0 upwards, so if there ever arises a need, it would be easy to differentiate. Also having versions would allow showing deprecation notices (failing a build until An example would be this issues base idea, if we don't find a |
Maybe I do not get it, but what would be the difference between (on a pipeline / workflow level):
and
If possible I would not introduce new keywords for already existing concepts. You have twice the time to document it and users need to learn twice. In the end (#745, #567) It could be something like this:
The further down a condition is, the smaller the scope. |
Good point. Honestly there wouldn't be a huge difference. The main change I had in mind is forcing the user to set a top level filter for events. But now I think maybe removing the default filter would be enough, so the user would simply get a lot of pipelines in case he misses to set a filter as that's easily noticeable and fixable. As we always have one workflow per file (and I think there is no plan to change it) you can filter per workflow (top-level) and per step, so there wouldn't be a need to change a lot I guess. |
It might be a good idea to add a config flag allowing to prevent woodpecker from running without having top level event filters set (even if a user sets it to |
A config to force users to add some Do nothing -> everything stays the same. If one wants to have more events: add a when condition. |
IMHO that's a bad idea, it would be keeping some legacy behavior as default (I'd leave it for legacy configs, if we would really implement config-schema versions and handle them differently), which then is going to confuse users joining in after 1.0, also it would basically mean some events are opt-in and some opt-out, which is fairly opaque when working with a system and mostly only makes sense when you know the legacy behind it (which is the effective reason for that behavior). Also, the 'If one wants to have more events: add a when condition.' would mean you'll need to list all events in the |
Ok, I can agree on that one.
In my experience, you never want all events, but you will not want no events too. So I am undecided on this one. |
Then we'll need to decide on "all or nothing" either you have to always specify a filter (and it's only triggered if it's matching) or we default to all events and users will have to filter out what they don't want. Both have their merits, using a default of no match requires the user to specify exactly what he wants (and therefore should be "non-breaking" if we add new events), defaulting to all means a user can either filter or "just not care" (which is what I believe a good pipeline should be able to do, basically handle all cases or fail / abort if it's not needed). The advantage of defaulting to none (explicitly declare on which events) only holds true, if we disallow wildcards and exclude (else the pipeline will potentially take up new events added later on). And I'm tempted to say mixing defaults (some default on others off) would be the worst option as it would mess with consistency in docs, the mindset,... |
I think, we should go with all, because giving up on wildcards or excludes is too much of a sacrifice. Docs should be clear on that though. |
Whell what if we have a ... well we did once got rid of it ... filter for events in the repo config with by default only the "tag, pull, push, deploy" events allowed? so we have a default filter but its per repo settings ? |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
We may add new pipeline events in the future:
Possible events:
Adding a
when.event
filter for each pipeline or step would be quite complex and having a default value like skipping crons should probably be avoided as it can not easily be expected by an user:Maybe we can add a new
on
/trigger
keyword instead. By default a pipeline would not be executed at all. The linter could throw an error if no "trigger" is set at all. If a user adds one or multiple "trigger" events the pipeline will be executed for those events and contained steps can be filtered bywhen.event
.originally from #286 (comment)
The text was updated successfully, but these errors were encountered: