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

4 webhooks dispatched one after the one, only 2 picked up #220

Closed spidey closed 2 years ago

spidey commented 2 years ago

I have GitLab webhooks configured for a given repository dispatching note (comment) events on merge requests. A given string should trigger a pipeline configured with the Generic Webhook Trigger plugin with the regexp filter rules set up. Four of these events were dispatched by GitLab and correctly received by Generic Webhook Trigger endpoint, confirmed by the response it returned to GitLab: listed the possible jobs, the regexp rules and expanded variables that should match and the "triggered" flag in the payload. For example:

{
  "jobs": {
    "job-RetriggerMerge": {
      "id": 6644819,
      "regexpFilterExpression": "^note#false#retrigger-merge$",
      "regexpFilterText":        "note#false#retrigger-merge",
      "resolvedVariables": {
             "trimmed": "not relevant"
       },
      "triggered": true,
      "url": "queue/item/6644819/"
    },
  "message": "Triggered jobs."
}

Generic Webhook Trigger Plugin 1.72 Jenkins 2.263.4

The repository is private and self-hosted, I can't give access for debugging. This is the first time I've seen this issue, other times I had issues that I could track down either to a GitLab configuration issue, the webhook endpoint throwing errors for some reason (and then I could debug the HTTP response), or pipeline issues. But the webhook succeeding with HTTP 200 and valid data but no jobs being triggered on Jenkins is a first.

I wonder if there are any plugin logs that I could investigate.

tomasbjerre commented 2 years ago

Have you seen this section in the readme? https://github.com/jenkinsci/generic-webhook-trigger-plugin#trigger-exactly-one-build

spidey commented 2 years ago

Thanks for the fast feedback. This job has no build parameters, but is instead relying on the variables injected by the plugin. This seems indeed to be the case, I had in mind the "parameters" of the payload, so branch name, MR id, etc. Thank you for the help.