Is it possible for sonarqube to save the rules in git along with the project's source code?

Is it possible for sonarqube to save the rules in git along with the project's source code? In other words, is it possible to control versioning rules for different branches of a project?

+3


source to share


1 answer


Can I save my profile to Git?

Yes. You can export the profile to a file using the backup function. (Note that rule settings are not included )

Is it possible to have SonarQube repository profiles in Git?

Not. During the analysis, your SCM will be requested for wine information, but no part of the SonarQube ecosystem commits.

Can I update profiles and apply different versions for different branches of a project?

Yes, but why do you want?



It makes no sense to re-parse branches that don't change. This means that if you improve or tighten your standards, you don't want to apply those higher standards for new development that happens on your branches.

"But the new rules would bring up all the new problems in our branches, and I don't want to solve them, because we don't do new developments there, we just fix it." I can hear you speak.

Of course, but if you are using a recent version of SonarQube (> = 6.3) then these new issues will be raised with a date that matches the date of the line's fault. I.E. they will not arise as problems with the flow, but as old problems. Since you seem to be keeping a clean leak period on your branches, this should all work out.

But to answer your question, there is no need to keep old profiles in SCM, just flush copies in SonarQube and assign them to their respective branch projects.

But if you insist on doing this using backups registered with SCM, keep in mind that you will need to restore (re-import) your profiles to SonarQube before analyzing. You cannot just specify the analysis in the rule list file and expect it to work.

+2


source







All Articles