I don’t believe anything in the template is relevant to my question, please correct me if I’m wrong!
I’m currently trying to migrate a large, legacy software project from a very outdated version of SonarQube to SonarCloud. One of the things we occasionally do is to re-baseline the project - where a small change to a file with lots of issues fails the analysis because SonarQube thinks all the issues in that file are new code, we need to tell it “actually, ignore those issues, the project as it stands is fine”.
Our project has a New Code Definition of “Any code that has changed since the previous version is considered new code” - does this mean that in order to do this rebaselining, all we’d need to do in SonarCloud is to manually re-run the analysis with a different version? Because that should lead to the code that was flagged in the previous analysis now being considered old code - however, upon testing this I found the quality gate still failed.
What do I have to do, ideally that doesn’t include “changing the code”, to move issues that are currently being flagged as “new code” into “Overall code”?
With a New Code Definition of “previous version” – your first analysis on SonarCloud should stick all your code in the Overall code period, with all future analyses being considered “new code”.
Indeed, any new “version” being passed (including manually adding a version to an analysis in the Activity tab of of your branch) should reset the new code period.
I don’t know what version of SonarQube you’re coming from – but this really shouldn’t happen, and I’d be surprised if it does anymore (happy to be proven wrong and troubleshoot that if so)
I don’t know what version of SonarQube you’re coming from – but this really shouldn’t happen, and I’d be surprised if it does anymore (happy to be proven wrong and troubleshoot that if so)
We’re coming from Version 6.7.6 (build 38781) - so a very old one, which should give an idea of how legacy our project is, and hence why being able to re-baseline is important to us!
I’ll check if fixing an issue/adding an issue to an eisting class causes those issues to flag up again in SonarCloud - this might have been changed.
What conditions failed?
Upon re-checking, I found the gate did in fact pass, and simply needed to wait a minute for the update to filter through to the web UI. My bad