We recently started using SonarQube against some legacy code, and SonarQube found a bunch of issues which we won’t fix immediately. We’re using SonarQube to fail builds with NEW issues but not to worry about the existing issues. The definition of New Code for this project is set to “The New Code will be based on the analysis following the previous version”. None of the existing issues have been reviewed.
That was fine until we upgraded to a new version of SonarQube which detected some additional issues; also, at about the same time we spotted that some files were not being analyzed, so we added them in, and they contribute yet more issues. These recently-uncovered issues are no more important than the issues SonarQube had already found, but because they were not detected in the previous version they are reported as “new” and are thus causing builds to fail.
What I tried was to create a new branch off master, and then change the definition of New Code to use this as a Reference branch. I expected master builds to not report any new issues at that point, but all the recently-uncovered issues are still being reported as ‘new’.
Should using a reference branch have worked?
SonarQube Developer Edition Version 8.4.2