Cleaning old tests in sonar after deletion of old branches(repositories) in git

847 views
Skip to first unread message

Александр Бердега

unread,
May 10, 2017, 3:18:46 PM5/10/17
to SonarQube
We use git through Stash / Bitbucket, Sonar 6.2 (Postgresql) and Teamcity to comunicate them. The DB growing very fast and we noticed, that we have a lot of old tests(older than 2-3 months ) that are not needed. The first idea was to create several partitionig of the biggest tables (project_measures, file_sources and others), then after couple of month remove inherit  from oldest partitions and look is there any updates or inserts in their rows or not. But this idea not so good because most of tables in sonar DB didn't have TimeStamp. The next idea was : If there is a plagin (Stash) which is compare the versions he maybe could check if there any deleted branches, versions or even projects in Stash/Bitbucket and according to this - delete old test information from Sonar DB. 

Maybe some one has not the same, but similar problems and can give me some advice - It would be fantastic.
Thank's for your replies and have a good morning/day/evening.

G. Ann Campbell

unread,
May 15, 2017, 12:28:12 PM5/15/17
to SonarQube
Hi,

If I understand correctly, you have stale projects in your instance that are bloating your database. What's not clear to me is whether these are independent projects, or branches. If they are branches, then you should be able to delete them via Administration > Projects > Management. Search for the common project name, select all the old branches and Delete.

Note that robust branch management is on our roadmap for the next LTS (E.T.A. October), so that once you get your instance cleaned up, this should become easier to manage in the future.

Also, because this must be said, NEVER MANIPULATE YOUR SONARQUBE DATABASE DIRECTLY. Instead, treat it as a black box, and make all changes through web services, analysis, or the UI.


Ann
Reply all
Reply to author
Forward
0 new messages