Build configuration fails to trigger with same commit hashes

TeamCity version:  2017.1.2 (build 46812)
Running on Windows 2012R2
 
We have some projects with typical two build configurations:
 
One building for all branches with a Branch Specification like this:
 
+:refs/heads/(develop)
+:refs/heads/(master)
+:refs/heads/(release/*)
+:refs/heads/(feature/*)
+:refs/heads/(hotfix/*)
 
and one building only for master with a Branch Specification like this:
 
+:refs/heads/(master)
 
They use the exactly same Git VCS Root.
 
The problem arises in scenario like this:
 
You branch out from develop - creating e.g. a release/myrelease branch. When work on the branch is finished you merge it into master and pushes it. Then you merge it develop and pushes that.
 
It now happens from time to time that develop and master are essentially the same - and therefore has the same commit hash. This confuses TeamCity, which then chooses to build only one of the branches - most likely the one that it happens to check first or the one which was first pushed.
 
It is always possible to run the build configurations manually.
 
Either this is a TeamCity bug/missing feature, but whatever it is, I would love to get an idea to how I can work around this so both build configurations will be triggered always.
0
2 comments

Hi Trk,

TeamCity assumes that you don't want to build the exact same revision twice, so to save resources it only builds it once unless you explicitly ask it to (a.k.a. manual build). There is a configuration parameter that you can set to true that would force TeamCity to build in every branch. Simply set teamcity.vcsTrigger.runBuildOnSameRevisionInEveryBranch to true and it should work.

0
Avatar
Permanently deleted user

That does seem to do the trick. Thanks!

Maybe that property should make it into more places in the documentation, e.g. https://confluence.jetbrains.com/display/TCD10/Configuring+VCS+Triggers?

0

Please sign in to leave a comment.