jenkinsci / jenkinsci/git-plugin

[JENKINS-52816] scm poll triggers even there is no change in repository(bitbucket)

Open
#3,330 40 comments 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

step 1: create a seed job 

```

String basepath = 'Common/Java/testapp'

String giturl = 'git@​bitbucket.org:abc/testapp'

pipelineJob("$basepath/1.Build-Dev-Int") {

logRotator {

numToKeep(10)

artifactNumToKeep(10)

}

parameters {

stringParam('USE_GIT_BRANCH', 'master')

}

throttleConcurrentBuilds {

maxTotal(1)

}

triggers {

scm('H/15 * * * *')

}

definition {

cpsScm {

scm {

git


{
remote \{ url(giturl) }

branches('master')

extensions { }

}

scriptPath('pipeline/pipeline_dev_int.groovy')

}

}

}

}```

step 2 : create pipeline_dev_int.groovy

```@​Library('sharedlibrary@​master')

node()

remaining groovy script```

 

step 3:     configured shared library in manage jenkins

even though there is no change in repo it is triggering jobs 

 

 

whenever a branch/ commit made to the shared library even though there is no change in testapp repo it triggering the job for every 15 min and found this in polling history

Using strategy: Default

[poll] Last Built Revision: Revision 6717866352d0d5a5e9b41da88a799993ab1d4191 (origin/master)

No credentials specified

> git --version # timeout=10

> git ls-remote -h git@​bitbucket.org:abc/testapp # timeout=10

Found 3 remote heads on git@​bitbucket.org:abc/testapp

[poll] Latest remote head revision on refs/heads/master is: 6717866352d0d5a5e9b41da88a799993ab1d4191 - already built by 97

Using strategy: Specific revision

[poll] Last Built Revision: Revision a7cf4fd0c7484765c4a5166a36613c387aee8501 (surya/MCDCA-1412-ECR-NEW-ACCOUNT)

No credentials specified

> git --version # timeout=10

> git ls-remote -h git@​bitbucket.org:abc/sharedlibrary # timeout=10

Found 3 remote heads on git@​bitbucket.org:abc/sharedlibrary

[poll] Latest remote head revision on refs/heads/surya/MCDCA-1412-ECR-NEW-ACCOUNT is: ab8eb071afb815bca04fd4e50a991ae54ea37e8c

Using strategy: Default

[poll] Last Built Revision: Revision 6717866352d0d5a5e9b41da88a799993ab1d4191 (origin/master)

using credential 6e83116e-4fb6-491a-a2c9-9ac9d51d4765

> git --version # timeout=10

using GIT_SSH to set credentials

> git ls-remote -h git@​bitbucket.org:abc/testapp # timeout=10

Found 3 remote heads on git@​bitbucket.org:abc/testapp

[poll] Latest remote head revision on refs/heads/master is: 6717866352d0d5a5e9b41da88a799993ab1d4191 - already built by 97

Done. Took 8.6 sec

Changes found


Polling Log

This page captures the polling log that triggered this build.

Started on Jul 30, 2018 7:15:00 PM Using strategy: Default [poll] Last Built Revision: Revision 80ae1a7997f138af5faa0e594eca7e88eb174026 (origin/master) > git --version # timeout=10 > git ls-remote -h git@​bitbucket.org:xxx/xxxxxxx # timeout=10 Found 1 remote heads on git@​bitbucket.org:xx/xxxxxx[poll] Latest remote head revision on refs/heads/master is: 80ae1a7997f138af5faa0e594eca7e88eb174026 - already built by 185 no polling baseline in /var/lib/jenkins/workspace/Sandbox/xxxx/xxxx/1.Build-Dev-Int@​libs/xxx on Using strategy: Default > git --version # timeout=10 using GIT_SSH to set credentials Bitbucket SSH Key > git ls-remote -h git@​bitbucket.org:xxxxx.git # timeout=10 Found 1 remote heads on git@​bitbucket.org:xx/xxxx.git [poll] Latest remote head revision on refs/heads/master is: 80ae1a7997f138af5faa0e594eca7e88eb174026 Done. Took 2.7 sec Changes found

---
Originally reported by yrsurya, imported from: scm poll triggers even there is no change in repository(bitbucket)


  • assignee: daspilker
  • status: Open
  • priority: Minor
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 6
  • watchers: 11
  • imported: 2025-12-02

Raw content of original issue

step 1: create a seed job 
```
String basepath = 'Common/Java/testapp'

String giturl = 'git@bitbucket.org:abc/testapp'

pipelineJob("$basepath/1.Build-Dev-Int") {
logRotator {
numToKeep(10)
artifactNumToKeep(10)
}
parameters {
stringParam('USE_GIT_BRANCH', 'master')
}
throttleConcurrentBuilds {
maxTotal(1)
}

triggers {
scm('H/15 * * * *')
}

definition {
cpsScm {
scm {
git


{
remote \{ url(giturl) }

branches('master')
extensions { }
}
scriptPath('pipeline/pipeline_dev_int.groovy')
}
}
}
}```
step 2 : create pipeline_dev_int.groovy

```@Library('sharedlibrary@master')

node()

remaining groovy script```
 

step 3:     configured shared library in manage jenkins
even though there is no change in repo it is triggering jobs 
 

 

whenever a branch/ commit made to the shared library even though there is no change in testapp repo it triggering the job for every 15 min and found this in polling history

Using strategy: Default
[poll] Last Built Revision: Revision 6717866352d0d5a5e9b41da88a799993ab1d4191 (origin/master)
No credentials specified
> git --version # timeout=10
> git ls-remote -h git@bitbucket.org:abc/testapp # timeout=10
Found 3 remote heads on git@bitbucket.org:abc/testapp
[poll] Latest remote head revision on refs/heads/master is: 6717866352d0d5a5e9b41da88a799993ab1d4191 - already built by 97
Using strategy: Specific revision
[poll] Last Built Revision: Revision a7cf4fd0c7484765c4a5166a36613c387aee8501 (surya/MCDCA-1412-ECR-NEW-ACCOUNT)
No credentials specified
> git --version # timeout=10
> git ls-remote -h git@bitbucket.org:abc/sharedlibrary # timeout=10
Found 3 remote heads on git@bitbucket.org:abc/sharedlibrary
[poll] Latest remote head revision on refs/heads/surya/MCDCA-1412-ECR-NEW-ACCOUNT is: ab8eb071afb815bca04fd4e50a991ae54ea37e8c
Using strategy: Default
[poll] Last Built Revision: Revision 6717866352d0d5a5e9b41da88a799993ab1d4191 (origin/master)
using credential 6e83116e-4fb6-491a-a2c9-9ac9d51d4765
> git --version # timeout=10
using GIT_SSH to set credentials
> git ls-remote -h git@bitbucket.org:abc/testapp # timeout=10
Found 3 remote heads on git@bitbucket.org:abc/testapp
[poll] Latest remote head revision on refs/heads/master is: 6717866352d0d5a5e9b41da88a799993ab1d4191 - already built by 97
Done. Took 8.6 sec
Changes found


Polling Log

This page captures the polling log that triggered this build.
Started on Jul 30, 2018 7:15:00 PM Using strategy: Default [poll] Last Built Revision: Revision 80ae1a7997f138af5faa0e594eca7e88eb174026 (origin/master) > git --version # timeout=10 > git ls-remote -h git@bitbucket.org:xxx/xxxxxxx # timeout=10 Found 1 remote heads on git@bitbucket.org:xx/xxxxxx[poll] Latest remote head revision on refs/heads/master is: 80ae1a7997f138af5faa0e594eca7e88eb174026 - already built by 185 no polling baseline in /var/lib/jenkins/workspace/Sandbox/xxxx/xxxx/1.Build-Dev-Int@libs/xxx on Using strategy: Default > git --version # timeout=10 using GIT_SSH to set credentials Bitbucket SSH Key > git ls-remote -h git@bitbucket.org:xxxxx.git # timeout=10 Found 1 remote heads on git@bitbucket.org:xx/xxxx.git [poll] Latest remote head revision on refs/heads/master is: 80ae1a7997f138af5faa0e594eca7e88eb174026 Done. Took 2.7 sec Changes found

  • environment: we are using Jenkins LTS 2.176.3 on hosted on amazonlinux , job-dsl - 1.74 , git plugin - 4.0.0-rc

3 attachments

- [Screenshot from 2019-10-16 16-29-58.png](https://issues.jenkins.io/secure/attachment/49162/Screenshot%20from%202019-10-16%2016-29-58.png)
> ![Screenshot from 2019-10-16 16-29-58.png](https://issues.jenkins.io/secure/attachment/49162/Screenshot%20from%202019-10-16%2016-29-58.png)
- [Screenshot from 2019-10-16 16-42-12.png](https://issues.jenkins.io/secure/attachment/49163/Screenshot%20from%202019-10-16%2016-42-12.png)
> ![Screenshot from 2019-10-16 16-42-12.png](https://issues.jenkins.io/secure/attachment/49163/Screenshot%20from%202019-10-16%2016-42-12.png)
- [git.hpi](https://issues.jenkins.io/secure/attachment/51832/git.hpi)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.