Stop Teamcity showing deleted branches

Jon Lauridsen picture Jon Lauridsen · Mar 25, 2015 · Viewed 8.8k times · Source

We're using TeamCity, and I've set up jobs to pull from branches. But when those branches are deleted they still appear in Teamcity:

List of outdated branches, only refs/master is active

(List of outdated branches, but only refs/master is actually active)

The Teamcity documentation actually specifies what constitutes an active branch:

Active branches

In a build configuration with configured branches, the Overview page shows active branches.

A number of parameters define whether a branch is active. The parameters can be changed either in a build configuration (this will affect one build configuration only), project, or in the internal properties (this defines defaults for the entire server). A parameter in the configuration overrides a parameter in the internal properties.

A branch is considered active if:

  • it is present in the VCS repository and has recent commits (i.e. commits with the age less than the value of teamcity.activeVcsBranch.age.days parameter, 7 days by default).
  • or it has recent builds (i.e. builds with the age less than the value of teamcity.activeBuildBranch.age.hours parameter, 24 hours by default).
  • ! A closed VCS branch with builds will still be displayed as active during 24 hours after last build. To remove closed branches from display, set teamcity.activeBuildBranch.age.hours=0.

But... I don't understand their description! :) What do they mean with "parameters in the configuration"? I've tried making parameters in my jobs like so:

Adding parameter teamcity.activeBuildBranch.age.hours

(Adding parameter teamcity.activeBuildBranch.age.hours)

But that doesn't do anything. Maybe I'm exposing myself as a total TC noob, but can anyone guide me through how to correctly alter these settings so I only show repository-active branches in my build jobs?

Answer

Jon Lauridsen picture Jon Lauridsen · Mar 27, 2015

I suddenly had success after adding parameters to the project configuration. Before now I've been adding parameters to individual builds and never saw a difference.. Maybe that's just me misunderstanding the obvious.

enter image description here

enter image description here

This works in-so-far as the list of active branches is culled. There's still one deleted branch it considers active for reasons I can't yet decipher (history was rewritten several times in it), but at least all others are now inactive.