jenkinsci / jenkinsci/git-plugin
[JENKINS-63751] Git plugin incorrectly detects changes in PR with merge conflicts
- Dominant language
- Java
- Stars
- 694
- Forks
- 1.1k
- Avg merge
- 1h 29m
- Merged PRs (30d)
- 3
Description
The PR-187 job and the PR-182 job for the docker-inbound-agent on ci.jenkins.io runs every 30 minutes or 60 minutes and reports that the commit cannot be merged. The git polling log reports:
```
Started on Sep 23, 2020, 12:40:00 AM
Using strategy: SpecificRevisionBuildChooser
[poll] Last Built Revision: Revision 6089fb6c8549de12b90e5af4da82ba5ed9dce3e3 (master)
The recommended git tool is: jgit
No credentials specified
Found 9 remote heads on https://github.com/jenkins-infra/pipeline-library.git
[poll] Latest remote head revision on refs/heads/master is: 368501ef0ff03f3da9468394793cec7032903d68
Using strategy: SpecificRevisionBuildChooser
[poll] Last Built Revision: Revision d017b1219df68e5d70b5f7d256c7ec6762fddd3b (PR-182)
The recommended git tool is: jgit
using credential github-access-token
Found 5 remote heads on https://github.com/jenkinsci/docker-inbound-agent.git
Ignoring refs/heads/jep-15 as it doesn't match any of the configured refspecs
Ignoring refs/heads/slide-patch-1 as it doesn't match any of the configured refspecs
Ignoring refs/heads/alpine as it doesn't match any of the configured refspecs
Ignoring refs/heads/jdk11 as it doesn't match any of the configured refspecs
Using strategy: SpecificRevisionBuildChooser
[poll] Last Built Revision: Revision d017b1219df68e5d70b5f7d256c7ec6762fddd3b (PR-182)
The recommended git tool is: jgit
using credential github-access-token
Found 5 remote heads on https://github.com/jenkinsci/docker-inbound-agent.git
Ignoring refs/heads/jep-15 as it doesn't match any of the configured refspecs
Ignoring refs/heads/slide-patch-1 as it doesn't match any of the configured refspecs
Ignoring refs/heads/alpine as it doesn't match any of the configured refspecs
Ignoring refs/heads/jdk11 as it doesn't match any of the configured refspecs
Using strategy: SpecificRevisionBuildChooser
[poll] Last Built Revision: Revision d017b1219df68e5d70b5f7d256c7ec6762fddd3b (PR-182)
The recommended git tool is: jgit
using credential github-access-token
Found 5 remote heads on https://github.com/jenkinsci/docker-inbound-agent.git
Ignoring refs/heads/jep-15 as it doesn't match any of the configured refspecs
Ignoring refs/heads/slide-patch-1 as it doesn't match any of the configured refspecs
Ignoring refs/heads/alpine as it doesn't match any of the configured refspecs
Ignoring refs/heads/jdk11 as it doesn't match any of the configured refspecs
Done. Took 0.91 sec
Changes found
```
The pipeline definition is a declarative pipeline that looks like this:
```
/* NOTE: this Pipeline mainly aims at catching mistakes (wrongly formed Dockerfile, etc.)
* This Pipeline is *not* used for actual image publishing.
* This is currently handled through Automated Builds using standard Docker Hub feature
*/
pipeline {
agent none
options {
buildDiscarder(logRotator(daysToKeepStr: '10'))
timestamps()
}
triggers {
pollSCM('H/24 * * * *') // once a day in case some hooks are missed
}
stages {
stage('Build Docker Image') {
parallel {
stage('Windows') {
agent {
label 'windock'
}
options {
timeout(time: 60, unit: 'MINUTES')
}
environment {
DOCKERHUB_ORGANISATION = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}"
}
steps {
script {
powershell '& ./make.ps1 test'
def branchName = "${env.BRANCH_NAME}"
if (branchName ==~ 'master') {
// we can't use dockerhub builds for windows
// so we publish here
infra.withDockerCredentials {
powershell '& ./make.ps1 publish'
}
}
def tagName = "${env.TAG_NAME}"
if(tagName =~ /\d(\.\d)+(-\d+)?/) {
// we need to build and publish the tagged version
infra.withDockerCredentials {
powershell "& ./make.ps1 -PushVersions -VersionTag $tagName publish"
}
}
powershell '& docker system prune --force --all'
}
}
}
stage('Linux') {
agent {
label "docker&&linux"
}
options {
timeout(time: 30, unit: 'MINUTES')
}
steps {
script {
if(!infra.isTrusted()) {
deleteDir()
checkout scm
sh '''
make build
make test
docker system prune --force --all
'''
}
}
}
}
}
}
}
}
```
I closed PR-187 and noted to the submitter that it could be reopened once the merge conflict is resolved.
---
Originally reported by
markewaite, imported from: Git plugin incorrectly detects changes in PR with merge conflicts
Raw content of original issue
The PR-187 job and the PR-182 job for the docker-inbound-agent on ci.jenkins.io runs every 30 minutes or 60 minutes and reports that the commit cannot be merged. The git polling log reports:
Started on Sep 23, 2020, 12:40:00 AM
Using strategy: SpecificRevisionBuildChooser
[poll] Last Built Revision: Revision 6089fb6c8549de12b90e5af4da82ba5ed9dce3e3 (master)
The recommended git tool is: jgit
No credentials specified
Found 9 remote heads on https://github.com/jenkins-infra/pipeline-library.git
[poll] Latest remote head revision on refs/heads/master is: 368501ef0ff03f3da9468394793cec7032903d68
Using strategy: SpecificRevisionBuildChooser
[poll] Last Built Revision: Revision d017b1219df68e5d70b5f7d256c7ec6762fddd3b (PR-182)
The recommended git tool is: jgit
using credential github-access-token
Found 5 remote heads on https://github.com/jenkinsci/docker-inbound-agent.git
Ignoring refs/heads/jep-15 as it doesn't match any of the configured refspecs
Ignoring refs/heads/slide-patch-1 as it doesn't match any of the configured refspecs
Ignoring refs/heads/alpine as it doesn't match any of the configured refspecs
Ignoring refs/heads/jdk11 as it doesn't match any of the configured refspecs
Using strategy: SpecificRevisionBuildChooser
[poll] Last Built Revision: Revision d017b1219df68e5d70b5f7d256c7ec6762fddd3b (PR-182)
The recommended git tool is: jgit
using credential github-access-token
Found 5 remote heads on https://github.com/jenkinsci/docker-inbound-agent.git
Ignoring refs/heads/jep-15 as it doesn't match any of the configured refspecs
Ignoring refs/heads/slide-patch-1 as it doesn't match any of the configured refspecs
Ignoring refs/heads/alpine as it doesn't match any of the configured refspecs
Ignoring refs/heads/jdk11 as it doesn't match any of the configured refspecs
Using strategy: SpecificRevisionBuildChooser
[poll] Last Built Revision: Revision d017b1219df68e5d70b5f7d256c7ec6762fddd3b (PR-182)
The recommended git tool is: jgit
using credential github-access-token
Found 5 remote heads on https://github.com/jenkinsci/docker-inbound-agent.git
Ignoring refs/heads/jep-15 as it doesn't match any of the configured refspecs
Ignoring refs/heads/slide-patch-1 as it doesn't match any of the configured refspecs
Ignoring refs/heads/alpine as it doesn't match any of the configured refspecs
Ignoring refs/heads/jdk11 as it doesn't match any of the configured refspecs
Done. Took 0.91 sec
Changes foundThe pipeline definition is a declarative pipeline that looks like this:
/* NOTE: this Pipeline mainly aims at catching mistakes (wrongly formed Dockerfile, etc.)
* This Pipeline is *not* used for actual image publishing.
* This is currently handled through Automated Builds using standard Docker Hub feature
*/
pipeline {
agent noneoptions {
buildDiscarder(logRotator(daysToKeepStr: '10'))
timestamps()
}triggers {
pollSCM('H/24 * * * *') // once a day in case some hooks are missed
}stages {
stage('Build Docker Image') {
parallel {
stage('Windows') {
agent {
label 'windock'
}
options {
timeout(time: 60, unit: 'MINUTES')
}
environment {
DOCKERHUB_ORGANISATION = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}"
}
steps {
script {
powershell '& ./make.ps1 test'def branchName = "${env.BRANCH_NAME}"
if (branchName ==~ 'master') {
// we can't use dockerhub builds for windows
// so we publish here
infra.withDockerCredentials {
powershell '& ./make.ps1 publish'
}
}def tagName = "${env.TAG_NAME}"
if(tagName =~ /\d(\.\d)+(-\d+)?/) {
// we need to build and publish the tagged version
infra.withDockerCredentials {
powershell "& ./make.ps1 -PushVersions -VersionTag $tagName publish"
}
}powershell '& docker system prune --force --all'
}
}
}
stage('Linux') {
agent {
label "docker&&linux"
}
options {
timeout(time: 30, unit: 'MINUTES')
}
steps {
script {
if(!infra.isTrusted()) {
deleteDir()
checkout scm
sh '''
make build
make test
docker system prune --force --all
'''
}
}
}
}
}
}
}
}I closed PR-187 and noted to the submitter that it could be reopened once the merge conflict is resolved.
environment
```
Jenkins 2.249.1
Git plugin 4.4.2
ci.jenkins.io
https://ci.jenkins.io/job/Packaging/job/docker-inbound-agent/job/PR-182/
```
Contributor guide
Assessment
This issue has not been assessed yet.