I'm using TeamCity 2019.2 with Gitlab and I have set up already a build which can be triggered whenever there is a merge request created.
So my build uses 4 vcs roots and I've found when there is an issue when merge request with same number exists on other roots, i.e new merge request was created on root_1 with id 33 it turned out there is an old mr with the same id in root_4
therefor build was triggered with source code fetched from new mr/33 for root_1 and and old mr for root_4 and default branches for root_2 and root_3
which of course is incorrect
in gitlab all these 4 projects have a webhook configured to be run on push and merge events to those particular roots, so: project_1 -> root_1 project_2 -> root_2 ...
all roots sitting within one build
As a workaround I have created four individual builds which monitors MR request on dedicated root only, so:
root_1_mr_build:
- root_1 - merge-requests/*
- root_2 - default
- root_3 - default
- root_4 - default
root_2_mr_build:
- root_1 - default
- root_2 - merge-requests/*
- root_3 - default
- root_4 - default
etc