3

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)

Graham Clark
  • 12,886
  • 8
  • 50
  • 82

2 Answers2

0

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.

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
vitnet
  • 21
  • 4
  • 1
    As far as I can tell old builds *are* getting cleaned up. We've got Clean-Up Rules applied to everything that say builds over 5 days old are deleted, and when I look at the history for the "pull requests build" project, it's pretty small. – Graham Clark Aug 21 '18 at 07:23
0

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.

Didier Aupest
  • 3,227
  • 2
  • 23
  • 35
  • I'm using the `teamcity.activeBuildBranch.age.hours` setting - this causes builds for merged pull requests (i.e. inactive branches) to be removed from the main list quickly. The `teamcity.branchChooser.inactiveBranchesLimit` sounded promising but it doesn't seem to have any effect, and I can't find any documentation on this on JetBrains' site... – Graham Clark Aug 21 '18 at 07:33
  • The value for: `teamcity.branchChooser.inactiveBranchesLimit` should be set in `internal.properties` tab, inside the `Administration` panel, under `Diagnostic` section. I have tried it, and it works here (TC 10.0.3) – Didier Aupest Aug 21 '18 at 08:45
  • Thanks, I clicked "edit internal properties" in the Diagnostics section, and added `teamcity.branchChooser.inactiveBranchesLimit=10`. Still got ~400 branches in the list shown in my question. Am I missing something? – Graham Clark Aug 22 '18 at 13:04
  • Oops. I tested to limit the number of inactive branches inside the top left combobox, but not in the "Run ...", sorry. My bad. I don't have any other clues... – Didier Aupest Aug 22 '18 at 17:13