Teamcity triggering a build on a merge
Asked Answered
S

2

9

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.

Sawyers answered 12/12, 2013 at 8:17 Comment(6)
What's the "Root" path on your Version Control Settings page? Does it include the top level folder or the solution folder only?Abomasum
Its set to the root path of the Repo, which will be the top level folderSawyers
Try setting it to the solution folder.Abomasum
@Sawyers Did you resolve this? We are having the same issue.Coniferous
@Coniferous No we never did, gave up in the end :(Sawyers
Could you post your VCS trigger rule configuration?Spokeshave
S
1

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.
Spokeshave answered 1/6, 2016 at 14:0 Comment(2)
This sounds about exactly what was happening but that was a long time ago.Sawyers
Thanks! It appears that this new behaviour was introduced in TC9. We just need to update :)Wetnurse
A
0

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

Abomasum answered 3/1, 2014 at 17:47 Comment(1)
Thanks that's exactly what we have but only on a merge it will trigger a build when the changes came from another folder. What I might do is add a blanket exclusion and see if that helpsSawyers

© 2022 - 2024 — McMap. All rights reserved.