3

I am using SonarQube to analyse my code (in Maven Java). Every time I run my analysis, a report is generated and published to my SonarQube server. However, I would like to only publish my SonarQube analysis, when I run master branch (meaning that if I use SonarQube analysis with any other branch, the report should not be placed on the server but the analysis still needs to be done).

I know that there was sonar.analysis.mode parameter that used to do precisely what I want to do now. However, from this post's discussions I learnt that it was deprecated since v7.4 (I use v7.9+). From the same post, I learnt about branch analysis method (supposed 'alternative'), but if I understood correctly, the analysis report still gets placed on the server, though be it for a short time. I am afraid that it is still not good enough (unless I misunderstood or there it can be configured to be like sonar.analysis.mode).

My question is then as follows: was there ever found a workaround that would ultimately do what sonar.analysis.mode used to do? Maybe there is an API parameter that would prevent the analysis report being placed on the server (can one delete the analysis report, without admin privileges, but still retain analysis's info somehow)?

I am aware that I am essentially asking for a functionality that was removed due to reasons provided here. As such, any alternatives that I may look into will also suffice (thought I still would really like workaround using SonarQube API or something similar).

Joe
  • 337
  • 6
  • 21

0 Answers0