Why is Quality Gate passed when the rules are violated?

We have our quality gate configured with at least 70% code coverage on new code. Despite this, I just saw this PR pass with flying colors:

Notice how it picks up on the 14 new lines to cover, and reaches a 0% coverage yet still goes “Yep, OK”

We’re seeing this more and more often, and for the life of me I can’t figure out why it happens. I even tried switching to the “Sonar way” quality gate, and the same thing happens.

Hi @stsenvidan ,

When there is less then 20 new lines, SonarCloud ignored new code.
It was discuted in this topic Coverage not analyzing less than 20 lines on new lines

Thanks a lot for your help @Bachri_Abdel - though I’m a bit bummed out to find that we cannot disable this “feature”.

I’ve informed our organisation about this shortcoming, and asked everyone to always do PRs that are 20 lines of code or more.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.