generic-webhook-trigger-plugin
generic-webhook-trigger-plugin copied to clipboard
Ability to view evaluated text and regex matches from Optional filter
I have the following options:
Variables
Variable | JSONPath Expression | Value filter |
---|---|---|
$changed_dir_files |
$.commits[*].['modified','added','removed'][*] |
None |
$ref |
$.ref |
^(refs/heads/|refs/remotes/origin/) |
Optional filter
Expression | Text |
---|---|
master\s((.*"(books/|common/|sqs/|security/|common-test/|db/)[^"]+?".)|(."[^/"]+".*)) |
$ref $changed_files |
Would it be possible to view the following Optional filter
data within Jenkins (not only in the response of the request to https://<JENKINS_URL>/generic-webhook-trigger/invoke)
:
- Expression - same as in the response, e.g.
"regexpFilterExpression": "master\\s((.*\"(legal-values/|common/|sqs/|security/|common-test/|db/)[^\"]+?\".*)|(.*\"[^/\"]+\".*))"
- Evaluated text when variables are used in
Text
field, same as in the response
"regexpFilterText": "master [\"README.md\"]"
- Regex matches. It would help us to see what the given regex matches and why might not work.
When you say "within Jenkins", do you mean the build log? So only for jobs that are triggered?
The information can be presented in the build log, when the regex matches, but I don't know where the content goes when doesn't match.
It can be logged to the global Jenkins log. And you would need access to that.
The access is not an issue. I already have few log recorders for hooks:
Here is Github Pull Request Hook
Ok.
I think most users are able to invoke the Jenkins instance with curl
. And will get a clear response from that.
The downside of implementing this is the risk of spamming logs. And it would probably require an extra checkbox in the GUI to enable/disable this logging.
So it would add some complexity that I don't feel is needed as you can do the same thing with curl
.
The response of curl
doesn't print what has been matched.
Regarding logs, you already have few checkboxes, so another one won't hurt anyone :), compared to the benefits.
What about doing something similar to what the Multibranch Pipeline plugin does? Add an even log link that lists requests coming in and triggered jobs if any.
Feel free to submit a PR.
Well I don't use Jenkins anymore, so feel free to close this issue.