Issue with branch cleanup

Chris Wundram January 9, 2014

I had an issue with a plan branch that wasn't built for a couple of weeks. It appears that bamboo removed the plan branch, even though the branch still existed in git. I'm guessing that this was because of the automatic branch cleanup.

A few issues/questions.

1. How do I adjust the time a branch has to be inactive before it is cleaned up. The default time is much too short for us.

2. When I re-add the branch, the build number is back at #1. This is a big problem because we use the build number and the branch name to generate a version number. When the build number goes back to 1, we end up reusing already used version numbers. How can I get the build number back where it should be. So far I have had to press build branch, and stop build, n times to get the build number back to n. This isn't a big deal if the last build was something like 15, but if it was 115, this is a big issue.

Now that I look, I see a few plan branches that have been cleaned up that shouldn't be. How can I get these back? Can I set a pattern that branches with names that match release/* should not ever be cleaned up like this?

1 answer

1 vote
Jason Monsorno
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 9, 2014

The setting is on the Branches tab in Plan configuration. You can override deletion on a per branch scenario by going into the branch's configuration and selecting "Do not clean up this plan branch automatically." If you want to preserve a subset of branches then I think you'd have do it manually or make a custom job that try to set them every so often, basically Bamboo can't do it. If automatic deletion is anything like manual deletion then you can't recover it, you may be able to make a new branch alter the DB and restart Bamboo to get back your build number but that's about it. Personally we try to be CI tool independent, I use the build number as a hint if it's available (always handled as a nullable int) but rely on revision and build time.

Chris Wundram January 9, 2014

Any idea what the inactivity time is? Is there any way to change the time? I'm thinking it should be at least a couple of months.

Jason Monsorno
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 9, 2014

It will show you on the Plan Configuration page, the default is 30 days and clean up is run at 3 a.m. (at least mine says that, it may be locale based)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events