0

I currently have a SonarQube instance setup with multiple projects. Currently I get multiple requests every few weeks to update the quality profile to include a new rule or to remove an old one. This is usually followed by me having to recreate the projects and then sequentially running analysis again so that I can have the differential view again starting from a baseline code. This is becoming a pain as the number of projects grow. Is there any alternative to this? For instance is there any way to tell Sonar to pick up the new rules from the quality profile and run the existing analysis again against these rules.

If I don't do that I get a spike in issues as new rules get added and a new analysis is run as the existing analysis wasn't run against those rules and doesn't have an accurate issue number.

Thanks for the help!

Hans
  • 2,419
  • 2
  • 30
  • 37
onelight17
  • 11
  • 2

2 Answers2

0

Once you have linked a profile to a project, you can change the rule set and it will be used during the next analysis. As you add or remove rules, spikes are normal. Propably what you want to ensure is that for example no new rules are introduced as you want to ensure the quality is not going down, but is always improved. You can do it using quality gates and build breaker plugin. Hopefully I could help.

Oleg Majewski
  • 989
  • 1
  • 9
  • 13
  • Hello. Thanks for the suggestion however that is what I have been told to avoid. When a new rule is added it needs to run against the old code that analysis was run on before as well as the new code now to show that issues have decreased. Currently what is done is that the ruleset is ran against analysis for subversion code with revision for 4 months back and then sequentially till the HEAD revision to monitor progress in code quality. So is there a way to run the ruleset automatically on all the data without having to rebuild everything? Thanks – onelight17 Nov 20 '14 at 03:35
  • I wanted to let time to someone to eventually give you a different answer. Now I believe it is not possible to do what you want automatically or in one single task, but that you have to proceed as you do, which is to re-run all previous versions with the new Quality Profile. – Qualilogy Nov 27 '14 at 13:17
  • Now, what is your use case? Why/what do you want to know about the previous versions with the new Quality Profile? – Qualilogy Nov 27 '14 at 13:18
0

I am not sure to understand very well what you want to do, if this is running again a new (changed) profile to all previous versions of a project, or to apply different profiles on different versions of a project.

Maybe this could help you ? SonarQube - analyzing branches of the same project How to configure Maven to run a SonarQube project analysis with two different quality profiles?

Community
  • 1
  • 1
Qualilogy
  • 789
  • 5
  • 6
  • Yes I understand the confusion. I am trying to run a changed profile to all previous versions of a project without having to rebuild the project from scratch. This means that I don't simply want to run another analysis and add that to the timeline. I want every timepoint to reflect this changed profile. Hope that makes sense? Thanks – onelight17 Nov 21 '14 at 21:51