Issue with branch cleanup

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

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.

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.

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
Community showcase
Posted Jan 15, 2019 in Statuspage

Introducing Statuspage Getting Started guides! First up: What is Statuspage?

Over the next several weeks we'll be sharing some of our Getting Started guides here in the community. Throughout this series of posts, we'd love to hear from customers and non-customers ab...

264 views 4 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you