Make TeamCity Use Versionized Settings from Pull Request Branch
Answered
I have a setup where I have:
- Added a new VCS root to one of my projects in TeamCity via UI pointing to the repository of my product.
- Enabled versionized settings for this project and configured it to "use settings from VCS"
- Added subprojects, additional VCS roots and buildconfigurations using the Kotlin DSL where the pull request feature is active
When I now:
- Create a new feature branch where I make various changes to my teamcity settings
- Open a Pull Request
The builds will start, but they will still use the settings from the develop (default) branch of the VCS root created via UI. In the "Changes" tab I can see that it pulls the changes from the two VCS roots:
- (jetbrains.git) GitHub Develop and Release Branches | refs/pull/123/head <hash>
- (jetbrains.git) GitHub CI | refs/heads/develop
The build step I added in the pull request is missing during execution. What is needed to make TeamCity use the settings from the pull request? We have a strict integration policy with code reviews and green PR checks and I would like to treat changes to the build configuration just like changes to the product itself. For this the builds on the PR need to use the updated settings of the related branch.
I hope somebody can help me out here.
Greetings
Daniel
Please sign in to leave a comment.
Nevermind, I figured it out by trial and error having some assumptions.
How I solved it:
It seem important that the VCS root for versionized settings is on the same level as the versionized settings configuration. Once this is given, you can select it.
This allows me to have the VCS root for versionized settings also within the versionized settings. I was concerned about a chicken-egg problem but it somehow sorted out for me with stepwise changes.
Topic closed 😁