Feature Request: Allow manually selecting of VCS settings by SHA/branch

Hello,

From the custom build dialog, I propose that the “Use settings:” dropdown under the “Changes” tab should behave the same as the “Build branch:” dropdown where you can select a branch/tag to use as the settings for that build. I know TeamCity can already change VCS settings based on the branch name of the build being ran, e.g., running a build on `dev` branch in the code repo will use the `dev` branch in the settings repo. However, the problem I am having is when a branch doesn't exist in the VCS settings and I want to use another branch's settings that isn't the default.

In both our code and settings repos, we use `development` as our working (default) branch and `master` as our prod branch. Typically, this works great for us since we create and work off feature branches which correctly uses the default branch in the settings repo (`development`) for builds, and then when we are ready to cut a release we merge `development` into `master` in both our code and settings repo.

The problem comes from when we need to create a hotfix off of `master`. We would typically create a hotfix branch off of `master`, do the work, and then merge back into `master`. However, running a build off of that hotfix branch would use the VCS settings from the default branch (`development`) rather than the settings that we want on the `master` branch. This usually isn't a problem but we have ran into a number of cases where the VCS settings have diverged enough that it breaks the build. We have a workaround by creating and pushing a branch with the same name to the settings repo but this is a really ugly solution for something that seems like it should be selectable from the custom build dialog. 

Thank you.

1
7 comments
Hi Kelvin,

Thank you for the feature request. Just to ensure that we are on the same page and to prevent any misunderstandings, could you provide screenshots to illustrate the desired behavior?

Best regards,
Anton
1

Hi Anton,

Sure thing. When running a custom build, you will see something like this under the “Changes” tab:

From here, I would like to be able to select which build configuration settings to use by clicking the “Use settings” dropdown box and having it populate with all the branchs/tags in the TeamCity settings VCS.

0
Dear Kelvin,

This option is designed only for selecting if settings currently defined on the TeamCity server or settings loaded from the VCS revision calculated for this build should be used.

I am trying to understand the underlying issue here, and it seems that feature branches should work here: https://www.jetbrains.com/help/teamcity/2024.03/working-with-feature-branches.html. You can use wildcards in the branches specifications. So, your default branch is 'development'; you also monitor the 'master' branch, and you can also add something like 'hotfix-*' to your branches specification. Now, you will have all branches started with 'hotfix-' in your VCS root settings, and they will also be monitored and built with the settings stored in VCS in this branch. Is this something that will work for your scenario? Or let me know if I misunderstood something in your scenario.

Best regards,
Anton
1

Feature branches are how I currently work around this problem, but it's very clunky. Having to manually go into the TeamCity settings repo and create a branch with the same name as the build branch I want isn't an ideal work flow.

Here is the current drop-down from the “Use settings” field:

Here it is from the “Build branch” field:

I have the TeamCity settings repo set up to use branch specifications, but it doesn't show up in that drop down.

All I'm asking is for the “Use settings” drop-down to list the branches on the TeamCity settings repo just like the “Build branch” drop-down lists branches on our code repo. That way I wouldn't have to create a branch in the TeamCity settings repo if there is one that already exists.

In my case, there is a branch (master) in the TeamCity settings repo that has the settings of our prod code. If I have to hotfix off “master” in our code repo, then a build would incorrectly use the *default* branch (development) in the TeamCity settings repo instead of the branch I really want (master).

 

 

0
Dear Kelvin,

I think I understood your scenario. I have created a feature request: https://youtrack.jetbrains.com/issue/TW-87268/Allow-selecting-the-TC-settings-branch-when-running-custom-builds. Please vote for it to receive notifications.

The previously proposed solution should work when the TeamCity settings are stored in the same repository as the project you are building.

Best regards,
Anton
1

I think you captured exactly what I want. Thank you for submitting that feature request. Let me know if you need any more information or screen captures to further explain my request.

I appreciate the help.

0
Dear Kelvin,

Could you communicate with the development team in the feature request I created and provide more details on your scenario? https://youtrack.jetbrains.com/issue/TW-87268/Allow-selecting-the-TC-settings-branch-when-running-custom-builds#focus=Comments-27-9694409.0-0.
Thank you!

Best regards,
Anton
0

Please sign in to leave a comment.