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

inspect github payload and build specific SHAs

      When two or more pushes happen in a small time frame, the github webhook in jenkins triggers multiple builds just fine. However, each of these builds is for the latest SHA in that git repository. Example:

      01:01:01 - User 1 pushes sha #1 to master branch
      01:01:02 - User 2 pushes sha #2 to master branch

      Jenkins receives the two POSTs and triggers two builds. Each of these builds simply does a git pull and starts the build script at sha #2. This has the side effect of never building sha #1 by itself.

      I'm not so great at Java, but looking at the GitHubPushTrigger.java file here:

      https://github.com/jenkinsci/github-plugin/blob/master/src/main/java/com/cloudbees/jenkins/GitHubPushTrigger.java

      It appears to never inspect the payload from the github call. Is it possible to have this code inspect the payload and build based off of the 'after' key? There is an example of the payload here:

      https://help.github.com/articles/post-receive-hooks

      I don't know how possible this is, but it would seem to be a great addition to the github plugin.

          [JENKINS-20518] inspect github payload and build specific SHAs

          Allan Feid created issue -
          Kanstantsin Shautsou made changes -
          Component/s Original: github-api-plugin [ 17496 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 152043 ] New: JNJira + In-Review [ 178164 ]

            Unassigned Unassigned
            crazed Allan Feid
            Votes:
            5 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: