TeamCity does not trigger build of default branch after a merge
I'm having a problem getting TeamCity to trigger builds in our team's Git workflow. We are using Gitlab CE and feature branches.
When a developer pushes to a feature branch, TeamCity builds that branch. Then the developer opens a Merge Request in Gitlab, which a maintainer will merge into master (the default branch). Because of our Gitlab settings, this merge is always a fast-forward. Therefore, after the MR has been merged, master has the same commit SHA as the user's feature branch.
At this point, I want TeamCity to build the master branch, but it does not. It shows "Pending (n)" for master, but never builds.
How can I force TeamCity to build master on every change?
Below are screenshots of my build settings.
1) Build configuration

2) VCS trigger

3) VCS info

Please sign in to leave a comment.
Hi,
As you can see in our docs linked below, a fast forward merge onto the default branch should still produce a build if the revision hasn't been built in the default branch before: https://confluence.jetbrains.com/display/TCD18/Configuring+VCS+Triggers#ConfiguringVCSTriggers-TriggeringaBuildonBranchMerge
There is a build parameter that you should be able to set,
teamcity.vcsTrigger.runBuildOnSameRevisionInEveryBranch=true, which should be true by default anyway, but if either your installation has modified it or there is something misbehaving it might help.If none of this works, please check the builds used for that revision (you can click on the change and then on the revision hash to locate all the builds that have run that specific commit) and ensure there is none in the default branch. If there are none, please send us the server logs, teamcity-server.log and teamcity-vcs.log in particular, making sure that they contain the time span when a fast forward was performed on the remote server. You can use the submit a request button on top of this page for that.
Adding a new parameter `teamcity.vcsTrigger.runBuildOnSameRevisionInEveryBranch` in my build config and setting it to `true` has fixed the problem. Thank you.
I don't have admin access to our TeamCity server, but perhaps someone had previously set the default value for that param to false. Since the param did not appear in the Parameters view for a build until I overrode it, I can't tell what the original value was.