Quality gate passes with new issues

q_gate
java
sonarqube

(JimB) #1

SQ 6.7.3
SonarJava 5.6

Quality gate to ensure no new issues is passing, even with new issues.

Configuration has leak period set to “BASELINE” - where BASELINE represents the last build which passes the quality gate. We’ve seen some situations where the quality gate is passing - even if there are new issues - which should cause the quality gate to fail.

This is obvious in the UI. In the yellow area which shown bugs/vulnerabilities/smells since the leak period, these are > 0. Yet the quality gate is shown as passed.

The quality gate generally works, but sometimes after a few submissions and revisions, it just passes without obvious reason.

See that there are 8 new code smells in the example below.


(Julien Lancelot) #2

Hi,

Indeed, as you’ve checked “Over Leak Period” on the “Issues” metric, it’s possible to have a green quality gate even if there are some issues on the leak period.
The reason is that using “Over Leak Period” checkbox, the quality gate will do a subtraction of the number of issues of the current analysis with the number of issues of the analysis matching the leak period => if you’ve removed more issues that you’ve added, the QG will be green.

To fix this situation, you should use “New Issues” to get a red quality gate when some issues have been introduced on the leak period, even if you’ve removed a lot of issues.

FYI, we’re currently thinking of simplifying the definition to the quality gate : https://jira.sonarsource.com/browse/MMF-473


(JimB) #3

Thanks! I never noticed that there was a “New issues” selection, separate from “Issues”.