How to automatically select non-default branches?
We want to have a deploy build configuration for release/* branches.
VCS Root looks like this:

Branch filter in the DeployRelease configuration looks like this:
-:<default>
+:release/*
When hitting the deploy button without manually selecting any branch, the deploy build fails with the following error message:
`Failed to collect changes, error: Builds in default branch are disabled in build configuration BuildChainTest / DeployRelease`
How to have TC automatically select the latest release/* branch for deploying?
Please sign in to leave a comment.
The default branch of the VCS root is always used as a fallback branch to use when the branch is not specified or the specified branch is not included by the branch specification (for example, when someone just clicks Run without selecting a branch). Please refer to the documentation: https://www.jetbrains.com/help/teamcity/2024.12/working-with-feature-branches.html#Default+Branch
So, if you exclude the default branch with the branch filter and click Run without selecting a branch, TeamCity will try to run the build on the default branch and cancel it because it's excluded. This is expected.
Please let me know if you have additional questions. And I would like to hear more details on the scenario you want to achieve and why, maybe there is another way to achieve this.
Best regards,
Anton
Hi Anton,
you already named the issue I have: “when someone just clicks Run without selecting a branch”.
We have a dedicated deploy build configuration for release/* branches and there is another one for master branch. I think people are just used to hit the Run button for master branch configuration and everything is fine.
While it is user error (they simply forget to select the branch) I also think that is a bit of a usability problem. Nothing tells them to select the branch, so people just click it, then the deploy fails, they read the error message and then run a 2nd deploy with the branch selected. I have a number of those in the build history.
What I am looking for is equal behavior to default branch deployment, where it simply selects the last successful build that matches the release/* branch filter and deploys that build.
Alternatively, something similar to ParameterDisplay.PROMPT where people are explicitly asked to select a branch in the Run popup would also be helpful.
Best regards
Joerg
I found a similar feature request. Please vote for it and subscribe to receive updates: https://youtrack.jetbrains.com/issue/TW-23844
There is also a possible workaround to force the Run Custom Build window by creating a parameter with Display: Prompt. See the first comment in the feature request for details: https://youtrack.jetbrains.com/issue/TW-23844/Option-to-force-branch-selection-on-clicking-Run-build-button#focus=Comments-27-386801.0-0
Best regards,
Anton
Hi Anton,
thank you for the link to the issue, I have upvoted it.
Though I fear, given that it is already 12 years old, it is probably stuck on the “never” pile.
Best regards
Joerg
The proposed workaround will effectively force the custom build window to open, reminding the users to select the branch. While it will not require the users to select the branch, it may serve as a reminder at least.
I hope this will help, even if a little bit. Please let me know if you have any further questions.
Best regards,
Anton