We have a quality gate breaking for a short lived branch where Sonar is reporting over 600 new lines of code where the commit only had 6 lines changed. With this massive amount of changes the sonar is seeing the code coverage metric fall below the default quality gate. Looking for assistance to tracking down why the new code and likewise the resulting code coverage metric got so confused.
Can you give more details about your context and environment? (which ALM are you using, with which SCM, which CI solution, … etc)
We are using Azure DevOps and Azure Git. Not sure what information you are looking for on ALM, if you can clarify that I would be happy to provide more information.
Azure DevOps and Git, that’s what I was looking for, thanks.
Are you doing a shallow clone for your build? This could explain why SonarCloud thinks that most lines are new.
Nope, just a default checkout. We are not specifying any options.
@dmeneses I need your help on that one, I don’t remember how we know which lines should be considered as new for the code coverage when you are on a short-lived branch :-/
When possible, we get that information from git.
@jtsievert do you have the logs of the scanner, preferably with verbose enabled?