PRs pass quality profile that should fail

I’m trying to figure out why this is occurring:

If I’m interpreting the metrics correctly, “- Coverage” means that the incoming code was not covered at all, so we will have 0% coverage if this PR were to get merged. I assume this is a problem with my coverage reports being generated incorrectly. However, if this is the case, why did the PR get passed? We are using the default Sonar-way quality profile, which requires a minimum of 80% coverage to be allowed to merge, so shouldn’t this fail?

Hi,

what is your Sonarqube version ? Real quality gates for PRs where introduced with Sonarqube 7.7

Gilbert

Hi Gilbert, I’m using Enterprise Edition Version 7.7 (build 23042)

Hi,

guess you won’t get much support for 7.7 Enterprise.
You should update to either 7.9.1 LTS or even 8.0 (7.9.2 and 8.1 are coming soon)
and see if your problem remains.

Running Sonarqube Enterprise 7.9.1 and 8.0 with Git under Azure Devops (formerly known as TFS) here and no problems with PRs and branches.

Gilbert

Hi,

Is it possible that there are no actual lines of code in your PR?

 
Ann

Hi,

i’ve seen it only at second glance, there is 1 warning in your screenshot upper right corner.
‘Last analysis had 1 warnings’
I’m sure now it’s related to wrong settings for coverage (Jacoco …)
see this github repo for helpful examples

Gilbert