Short lived branches are not deleted in the Cloud version


(Saitv) #1

Hi

According to docs https://docs.sonarqube.org/latest/branches/branches-faq/ the short-lived branches should be deleted after 30 days. Unfortunately, it does not work (for me) - on my way too long list of short-lived branches there are positions annotated as “2 months ago”. I suspect it could be a bug.

Is ther a way to delete all short-lived branches at once?

The doc says that the branch TTL can be changed in “Configuration -> General -> Number of days before purging inactive short living branches” - I cannot find such option in the cloud version :frowning: are there dfferences between standard (on-premise) and cloud version?


(Janos Gyerik) #3

Hi,

I suspect the stale short-lived branches that are not getting deleted are not targeting the default branch of the project. Is that correct? Please confirm.

We’ve discovered a bug: the housekeeping job that deletes stale branches only affects branches depending on the default branch of the project. https://jira.sonarsource.com/browse/SONAR-11439

I’m not aware of an easy way to bulk-delete stale branches. You can delete branches one by one using the UI, or using the Web API /api/project_branches/delete, possibly in combination with /api/project_branches/list to get a list of branch names filtered by type and analysis date.


(Saitv) #4

Yes, it describes my case.
Thank you for investigating this issue.