8
votes

We currently having a problem with Teamcity triggering builds with a VCS trigger when there are 0 file changes, our VCS roots are configured with Mercurial

We have a checkout rules setup to only checkout the necessary folder for the solution we want to build and we have a requirement to only build a solution if there are changes in the folder that the solution belongs

The problem we are having is teamcity is triggering a build when there aren't any changes on the folder, this only happends when we merge heads.

The pending changes will show 0 files and if you view the file changes the files shown are from a folder that isn't included in the checkout rules or the VCS trigger.

I can't seem to figure this one out, so any help would be appreciated.

2
What's the "Root" path on your Version Control Settings page? Does it include the top level folder or the solution folder only?Adarsh Shah
Its set to the root path of the Repo, which will be the top level folderJonathan
Try setting it to the solution folder.Adarsh Shah
@Jonathan Did you resolve this? We are having the same issue.BitMask777
@BitMask777 No we never did, gave up in the end :(Jonathan

2 Answers

1
votes

I guess TC9 documentation answers why this is happening. I know that this documentation is for newer version, but it seems to be about exact scenario you have.

Triggering a Build on Branch Merge

The VCS trigger is fully aware of branches and will trigger a build once a check-in is detected in a branch.

When changes are merged / fast-forwarded from one branch to another, strictly speaking there are no actual changes in the code. By default, the VCS trigger behaves in the following way:

  • When merging/fast forwarding of two non-default branches: the changes in a build are calculated with regard to previous builds in the same branch, so if there is a build on same commit in a different branch, the trigger will start a build in another branch pointing to the same commit.
  • If the default branch is one of the branches in the merging/fast-forwarding, the changes are always calculated against the default branch, if there is a build on same revision in the default branch, TeamCity will not run a new build on the same revision.
0
votes

Have you looked at the trigger rules? You can set a custom trigger rule to only run the build on changes to a specific folder.

http://confluence.jetbrains.com/display/TCD8/Configuring+VCS+Triggers#ConfiguringVCSTriggers-TriggerRulesExample