Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34727

WebHook events are not always successfully triggering Jenkins pipeline

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • core:1.642.4.2
      github:1.17.1
      github-api:1.75
      github-branch-source:1.6
      branch-api:1.7

      When committing multiple changes successively to the same branch and repo, some builds are never triggered.

      How to reproduce this (Assuming you have a GitHub Organization folder with WebHooks already setup):

      • Commit multiple changes successively with a minimum interval (few seconds). Usually 5 are enough.
      • You should see that a build is trigger containing the changes until a certain revision/sha, but not the last one.

      I have tried many times to do this and I believe this happen when changes are pushed while the Branch Indexing is running. Hence it seems easier to hit that issue when you have lots of branches on your repository.

      In my example, I have the following commit in that order:

      1. fb1de9187286a1c815dcda7bf143c18f4953a9e0 (included in the build)
      2. 933fd9547927aa545f48dfab0021ea69458ea6f7 (included in the build)
      3. 06cc4d2cc70a4a27b2004de84d50dbdc3b602bd4 (never built)
      4. ca5fbd5854b629beb6e407c0ed6356e222bcf638 (never built)

      Branch Indexing logs when the commit is detected shows:

      Changes detected in feature/feature1 (7e45d8ffaafb3c16567f82769ab6c2400d98068a → fb1de9187286a1c815dcda7bf143c18f4953a9e0)
      Scheduled build for branch: feature/feature1
      

      Next 3 branch indexing cannot detect the changes and show:

      No changes detected in feature/feature1 (still at fb1de9187286a1c815dcda7bf143c18f4953a9e0)
      

      This is where the revision check fails: https://github.com/jenkinsci/branch-api-plugin/blob/master/src/main/java/jenkins/branch/MultiBranchProject.java#L312

      I attached relevant logs (jenkins.log, branch-source.log, github-webhook.log and folder-queue-executor.log).

        1. branch-source.log
          1 kB
        2. folder-queue-executor-logs.log
          36 kB
        3. github-webhook.log
          2 kB
        4. jenkins.log
          2 kB

            amuniz Antonio Muñiz
            allan_burdajewicz Allan BURDAJEWICZ
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: