Short lived branches are not deleted in the Cloud version

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?

1 Like

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.

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

Hello,

What about the question
==> is there any dfference between SonarQube and SonarCloud regarding the branch TTL configuration as I cannot find such option in SonarCloud?
As per SonarCloud documentation: Short-lived branches are deleted automatically after 30 days with no analysis. This can be updated in Configuration > General > Number of days before purging inactive short living branches . Source: https://sonarcloud.io/documentation/branches/branches-faq/

any updates on this topic?

@janos This is still an issue, I keep having to go in and manualy clear out branches. The option to purge inactive branches in general setting just isnt there.

Any updates?