Unclear selection of branch on build type level
Hello,
We've been trying to model a setup for testing and deploying a number of microservices using TeamCity, but we've run into some confusion regarding how the branches and Changes work. We're trying to achieve to following setup:
- Every microservice has a separate build type that runs integration tests for each new commit appearing in the main branch of its corresponding GitHub repository. When the tests are successful, the given revision is tagged in GitHub with a new pre-release tag.
- There is a shared build type that should take the latest successfully tested version of each microservice (i.e. the latest pre-release tag created) and run end-to-end tests on this set of versions. We'd like the revisions list in the Changes tab to report each version's correct tag as the branch. We trigger this build via API, providing the “revisions” array with “vcsBranchName” containing tag and “revision” containing the corresponding commit.
However, while the separate build types for our microservices work as expected, we're hitting some issues with the shared build type; namely:
- there are around 50 VCS roots attached to it, each possibly with a different branch (= tag) used for a given build
- TeamCity, however, attempts to report a “branch” for the build as a whole; sometimes, this will be “<default>”, while sometimes it's a tag matched in one of the VCS roots
- also, the Changes type only reports the tag supplied via API in some cases; when the given tag's revision happens to be the same as the current latest main branch commit, “main” is reported instead
- when we tried to mitigate this by disabling building on the main branch, TeamCity would report that builds on the default branch are not allowed (even though we supplied non-default tags as branches for all VCS roots)
Additionally, we've tried just using the “main” branch and displaying tags in a custom report tab instead, but we have a use case when we want to use a revision that is not present in the main branch (a hotfix scenario, where the revision is found on a custom hotfix branch). When we try a build with a revision not present in main, though, the build type-level branch becomes a custom one, and Pending changes don't reflect that a build containing the changes was already run.
Is there some documentation for how the branch name is selected on the build type level when multiple VCS roots are attached? Does TeamCity support collecting multiple branches but considering them all “default” branches (for the purposes of displaying Changes and Pending changes)? Or alternatively, is there an API that would support supplying custom information to the Changes tab, so that we can ensure the commits we need are displayed there?
Thanks a lot for any support and guidance!
Please sign in to leave a comment.