-
New Feature
-
Resolution: Unresolved
-
Major
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:
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.
Maybe parsing the payload and setting as environment variables could be solved easily using ${sha1} as the branch to build. It is similar as how PRBuilder works.