Hi,
i have troubles to setup housekeeping project settings in an sonarqube instance and i hope someone has an idea where i do something wrong.
I would like to setup the housekeeping setting “Branches to keep when inactive” for a lot of sonarqube projects, i can do this through the UI (Project → Project Settings → Housekeeping) but as we get constantly new projects i would like to setup this through e.g. the sonar-project.properties, which gets into all our projects through a template. I cannot change it for the whole instance as it is a shared instance and only “my” projects require this change.
The key for this settings seems to be sonar.dbcleaner.branchesToKeepWhenInactive, but whenever i add this to my properties file and push it to main and let an analysis run through, the setting does not get changed.
Other settings like sonar.projectName get applied without any problems in the same runs.
I tried to do it with simple ones like:
sonar.dbcleaner.branchesToKeepWhenInactive=main
also with other values like
sonar.dbcleaner.branchesToKeepWhenInactive=main, master, develop, release-.*
But the value i see in the ui never changed.
So.. Where am i doing something wrong? Is it not intended to setup this setting through the sonar-project.properties and only through the UI or maybe through the api?
I would be grateful if someone could point me in the right direction.
I tested this on a sonarqube server v2025.1 with SonarScanner CLI 7.1.0.4889.