Quality gate not breaking for PR analysis

We’re using SonarQube EE version 7.9.4
The flow we are using:

  • Every branch is checked out of develop (our main branch on sonar).
  • When PRs are created/updated from those branches, gitlab CI starts Sonar PR analysis for them.
  • The quality gate looks something like:
    • Code smells: 100
    • New code smells: 5
  • As of now, the develop branch has these sonar measures:
    • Code smells: 98

The problem I’m facing:

  • I checked out a new branch from develop, and introduced 3 code smells.
  • On running the PR analysis on my pull request, the quality gate is not breaking.
  • I’m expecting it to break because the total code smells would be 101 in my branch. (more than the specified threshold which is 100).

Is this an expected behaviour? If yes, how can I make my PR analysis to consider overall code smells from quality gate?


As mentioned in the docs, Only the ‘on New Code’ conditions from your Quality Gate are applied to PRs.

Sorry, you can’t.


@ganncamp Are there any plans to allow admins being able to configure this behavior in future?


Not that I’m aware of.


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