-
Notifications
You must be signed in to change notification settings - Fork 164
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
Arbitrary script as a filter #258
Comments
Do you mean a Groovy-script? Perhaps it helps if you change the regexp to just Labeling this as enhancement. |
Passing in a groovy-function somehow would be really handy in some cases, where a RegEx does not work. |
Yes, for starters 😅 j/k, Groovy is fine, yes.
That's what we're doing now, but that results in a bunch of jobs triggered - with all the costs associated (disk space, workers, cloning shared libraries, etc), incl. the mental overhead for the users to ignore those jobs. |
On a related issue, is it possible for GWT to produce some diag info when a trigger fails the filter and therefore does not trigger the build? We have intermittent failures of GWT not triggering on some regex but works fine most of the time. It would be very helpful for debugging if GWT can tell why a filter has failed. |
It would be possible to add debug logging that would log why a job is not triggered. |
@tomasbjerre That would be very helpful. Thank you! |
I looked at adding logging and actually there is already logging here: generic-webhook-trigger-plugin/src/main/java/org/jenkinsci/plugins/gwt/Renderer.java Line 33 in 832267e
|
@tomasbjerre Thank you for the info. The log message should come out in Jenkins log? I think Jenkins at some point switched to systemd log so I looked there and didn't find anything there. Is there any other reason besides not matching a filter that GWT would refuse to trigger a build? I also see a massive number of the following in the Jenkins systemd log:
Do you have any idea what might be causing this? Thanks! |
Yes in the log. You have to enable fine logging, I do it like this: That other logging is discussed here #261 |
Yes I just find #261. Let me try fine logging. Thank you @tomasbjerre |
The regexp based filter is very powerful and can be used to accomplish almost anything, but as soon as you have any kind of complexity in terms of events you want to handle, it can very quickly become unmaintainable.
For example we have a use case to trigger the same job from the following:
main
branch updated in repo BAll of a sudden you find yourself with a regexp like
^(case 1)|(case 2)|(case 3)...$
where each case has to list out all the contributing variables (with a.*
at times).It would be handy to be able to pass in a simple script as a filter instead.
The text was updated successfully, but these errors were encountered: