jenkinsci / jenkinsci/gitlab-plugin
Jenkins doesn't build latest pushed commit
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 615
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 10
Description
## Issue
### Context
- **Gitlab plugin version**: 1.5.10
- **Gitlab version**: 10.8.5-ee
- **Jenkins version**: 2.121.3 (Dockerized)
- **Job type**: Single (Not-Multibranch) Declarative Pipeline
### Logs & Traces
- Jenkins Log:
[Jenkins_GitLab_Log.log](https://github.com/jenkinsci/gitlab-plugin/files/2424929/Jenkins_GitLab_Log.log)
- First Hook Request:
[first request.txt](https://github.com/jenkinsci/gitlab-plugin/files/2424942/first.request.txt)
- Second Hook Request:
[second_request.txt](https://github.com/jenkinsci/gitlab-plugin/files/2424947/second_request.txt)
- Third Hook Request:
[third_request.txt](https://github.com/jenkinsci/gitlab-plugin/files/2424951/third_request.txt)
- Screenshot of the commits CI (This screenshot isn't relevant with above commits - added for reference):

### Problem description
- what were you doing (simple push, merge request, MR with fork, ...)
We have a Jenkins server which triggered on push using the GitLab Jenkins integration hooks. When new commit being pushed to branch, it goes through 5 Jenkins stages. During one of last Jenkins stages it does `maven publish` step, which makes a 2 separate pushes back to repo. Hooks are being sent for those 2 commits done by maven, *but only pre-last commit triggers a Jenkins job*. That happens every time, when `maven publish happens` - latest commit pushed from `maven` (as Jenkins user) is being ignored by Jenkins.
- _what was expected_
So that every push would trigger a build for a newest commit in the push (maven does 2 separate pushes)
- _what occurred finally_
Second maven commit - GitLab sends hook to Jenkins, doesn't triggers a job.
First maven commit - GitLab sends hook to Jenkins, triggers a job.
My commit - GitLab sends hook to Jenkins, triggers a job.
Contributor guide
Assessment
This issue has not been assessed yet.