3
votes

TeamCity automatically kicks off builds for the branches created by GitHub Pull Requests. This is all fine, and its "Active Branches" list has the same number of items as there are Pull Requests in the monitored repository.

However, if I go to run a custom build for a specific branch, the "Build branch" list has many, many branches, the vast majority of which have been merged and deleted (we've got nearly 400 in the list now):

TeamCity "Build branch" list

Is there any way to clear this list down to only show Active Branches?

(this is TeamCity 10.0.4)

2

2 Answers

0
votes

As far as I am concerned, the inactive Pull Requests that were shown in the UI were Closed Pull Requests.

As a workaround, instead of using the run command which display a combobox which is not filtered, I use the dropdown inside on the top left corner at the project level, and not at the build configuration level.

If there is more than Closed Pull Requests, but merged one in the list, you should consider to set the parameter: teamcity.activeBuildBranch.age.hours to 0.

You can also reduce the number of showed inactive branches by adding the parameter: teamcity.branchChooser.inactiveBranchesLimit with the desired amound of inactive branches.

0
votes

the vast majority of which have been merged and deleted

If you absolutely sure that all of them have been deleted in your Repository and you still see them in TeamCity that means only one thing: you keep whole history of all your builds in TeamCity.

If you setup custom Clean-up policy for your build configuration you will reduce number of inactive branches in this list.

As variant you can make special build configurations for your Pull Requests and apply custom Clean-up policy only for it.