Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to keep false positives in sonar between branches?

Tags:

sonarqube

Is it possible in sonar to transfer "false positives" between branches?

This is our workflow: we develop in branch 1, we do our sonar checks on this branch, when branch 1 will be released, we merge this into the trunk, then we create branch 2 from the trunk, and we do our sonar checks on branches2.

This "branch 2" is a new sonar project (it can't be the same because we sometimes have 2 branches open at the same time and also 2 sonar projects). But this "branch 2" sonar project has lost all the "false positives" marks.

How can we keep the false positives between 2 branches?

like image 619
cremersstijn Avatar asked Aug 10 '12 14:08

cremersstijn


2 Answers

No, this is not possible yet. You can ask for this feature and discuss it on the Sonar user mailing-list.

like image 113
Fabrice - SonarSource Team Avatar answered Oct 01 '22 06:10

Fabrice - SonarSource Team


There is a plugin that can be used for this https://github.com/willemsrb/sonar-issueresolver-plugin (also available in update center)

Basically you export the resolutions from one branch into another one. This can be automated using your CI system since the plugin provides REST api.

  • Update issues from another project: http POST to /api/issueresolver/update
  • Export issues from a project: http GET to /api/issueresolver/export
  • Import issues in a project: http POST to /api/issueresolver/import
like image 22
Jakub Janoštík Avatar answered Oct 01 '22 06:10

Jakub Janoštík