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

Jenkins 2.375.2 and webhook trigger plugin Version1.86.2 #256

Closed ghost closed 1 year ago

ghost commented 1 year ago

when upgrade plugin from 1.84 to 1.86 my webhook trigger multiple builds against one webhook

tomasbjerre commented 1 year ago

Can you supply your configuration?

ghost commented 1 year ago

triiger1 trigger2 trigger3 trigger4

Hi tomas this is my configuration please do let me know Sir Thanks alot for help

ghost commented 1 year ago

tomasbjerre

tomasbjerre commented 1 year ago

Are you sure the plugin is invoked only once? Can you repeat that with a curl command? There are example curl commands in readme here on Github.

The culprit here is probably the option "allow several triggers per build". If the plugin is invoked several times, and you want just one build, you should check that box.

If you want exactly one build for each invocation of the plugin, you should leave it as is in your screenshots.

ghost commented 1 year ago

Thanks aloooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooootttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt

tomasbjerre commented 1 year ago

Did it get invoked several times? Or is it a bug?

ghost commented 1 year ago

according to my understanding from the description given under which is

(If checked, the plugin will allow one build to have several triggers. If not checked, the plugin will trigger exactly one job when invoked.)

this option should allow multiple trigger against one build but if webhook invoked again and again.....in my problem case webhook was invoked only once and multiple trigger started ..after turning this option ON now my webhook invoked only one trigger against one build... so i think this is a bug

tomasbjerre commented 1 year ago

Can you repeat that with curl?

tomasbjerre commented 1 year ago

I tried with a freestyle job. Just configured the token and set it to mytoken.

image

I invoke it with curl like this:

curl -vs http://theusername:thepasssword@localhost:8080/jenkins/generic-webhook-trigger/invoke?token=mytoken 2>&1

If I leave the checkbox unchecked, and invoke several times with curl, I get several builds with one trigger: image

If I check the checkbox, and invoke several times with curl, I get one build with several triggers: image

You may want to check these two checkboxes. If so, you will see, in the build log, the content of the webhook triggering the build.

image