We have a problem where despite no code changes SCM is triggering a build. SCM polls for changes every 15 minutes and should only trigger a build if changes are found.
H
Be carefull with svn redirections, in my case i had the same case Jenkins could not detect if svn has no changes and allways was triggering.
The problem was that in my jenkins svn configuration had this url:
https://xxxx.yyy.es:443/svn/myproject/trunk and its redirect to
http://xxxx.yyy.es:8008/svn/myproject/trunk (i dont know why)
Jenkins had to be configured with the last URL in order to detect the svn changes properly.
This is my issue Resolved.
http://antuansoft.blogspot.com.es/2014/10/jenkins-pool-smc-always-detect-changes.html
Seems to be reproducible with latest Jenkins GIT plugin version 2.0.
Downgrade to version 1.x may fix the problem. Though you should also revert Jenkins configuration from older backup as GIT plugin version 1.x seems to be not working with new 2.0 configuration scheme.
This thread suggests to enable "Fast remote polling" as a workaround. In version 2.0 it's called "Force polling using workspace" I think.
Reference to Jenkins issue: https://issues.jenkins-ci.org/browse/JENKINS-20767
I ran into the same problem.
What fixed it for me is noticing that the Git Polling Log looked like this:
Started on [date]
Using strategy: Default
[poll] Last Built Revision: Revision [commit#] (origin/develop)
[...]
Found 12 remote heads on ssh://[...]/repo.git
[poll] Latest remote head revision on refs/heads/feature/foo is: [commit#] - already built by 1414
[poll] Latest remote head revision on refs/heads/feature/bar is: [commit#] - already built by 2365
[poll] Latest remote head revision on refs/heads/feature/baz is: [commit#] - already built by 1489
[poll] Latest remote head revision on refs/heads/feature/qux is: [commit#] - already built by 1413
[poll] Latest remote head revision on refs/heads/develop is: [commit#] - already built by 2368
[poll] Latest remote head revision on refs/heads/master is: [commit#]
Done. Took 0.16 sec
Changes found
Notice that the line for master
doesn't say 'already built'. I built the master
branch and that fixed the problem.
I was experiencing this same issue today. It started happening when I added the "Delete workspace when build is done" publish task. I removed that task and it seemed to resolve the issue.
I just ran into Jenkins continuously building due to an SCM change, even when there was no change, and polling was not even turned on. This may be different from your scenario but I figured it may still help to share my solution.
Out project is configured to build using the branch specifier */integration
just like all of our other integration builds. However, after looking at all of the branches on our origin git repo, I saw that there are two branches that matched the */integration
specifier. It looks like a developer must have erroneously pushed to a new branch with a very similar name:
$git branch --remote | grep integration
origin/integration
origin/origin/integration
The solution that fixed this issue for me was to specify the branch fully, using refs/heads/integration
. I assume it would also work to simply delete the duplicate offending branch, but by specifying the branch exactly I can avoid running into the same problem in the future.
I'm not sure this is the same cause for your problem but this is what worked for me, and hopefully will work for someone else in this situation.