jenkinsci / generic-webhook-trigger-plugin

Can receive any HTTP request, extract any values from JSON or XML and trigger a job with those values available as variables. Works with GitHub, GitLab, Bitbucket, Jira and many more.
https://plugins.jenkins.io/generic-webhook-trigger
404 stars 159 forks source link

Condition doesn't correct for option allowSeveralTriggersPerBuild #255

Closed linuxoid69 closed 1 year ago

linuxoid69 commented 1 year ago

When reporting a bug, please try to provide as much information as possible.

You may also have a look at the test cases as they should answer the most common questions:

https://github.com/jenkinsci/generic-webhook-trigger-plugin/tree/master/src/test/resources/org/jenkinsci/plugins/gwt/bdd

If you are fiddling with expressions, you may want to checkout:

A Curl command can look something like this:

curl -v -H "Content-Type: application/json" -X POST -d '{ "app":{ "name":"GitHub API", "url":"http://developer.github.com/v3/oauth/" }}' http://localhost:8080/jenkins/generic-webhook-trigger/invoke?token=sometoken

I suppose that line contains not correct condition.

https://github.com/jenkinsci/generic-webhook-trigger-plugin/blob/aa6370b2930ac940ad7a210bff56ecf1aa129c2a/src/main/java/org/jenkinsci/plugins/gwt/ParameterActionUtil.java#L25

Correct as final boolean triggerOneBuildPerInvocation = allowSeveralTriggersPerBuild;

tomasbjerre commented 1 year ago

One trigger means one invocation, one call to /generic-webhook-trigger/invoke. The intention is to let each individual invocation trigger exactly one build. Should solve these issues where several triggers has been triggering same build: #64 #116 #126 #162 #171 #252