This an an archived version of the documentation for SonarQube version 4.5 & 4.5.x LTS.
See https://docs.sonarqube.org/display/SONAR/Documentation for current functionality
This concept of Quality Gates replaces the concept of Alerts since SonarQube 4.3.
The Quality Gates page is the place to define your requirements on projects. Requirements are set against measures, for example:
- No blocker issues
- Code coverage on new code greater than 80%
Ideally, all projects will be verified against the same quality gate, but that's not always practical. For instance, you may find that:
- Technological implementation differs from one application to another (you might not require the same code coverage on new code for Web or Java applications).
- You want to ensure stronger requirements on some of your applications (internal frameworks for example).
Which is why you can define as many quality gates as you wish.
Quality Gate Status
The Quality Gate Summary dashboard widget displays your quality gate status:
Note also that measures that break your quality gate are highlighted:
Getting Notified When a Quality Gate Fails
Thanks to the notification mechanism, users can be notified when a quality gate fails. To do so, subscribe to the New quality gate status notification either for all projects or a set of projects you're interested in.
Check also the Build Breaker plugin. This plugin marks your build as failed in your continuous integration tool when the quality gate fails.
The Quality Gates service can be accessed by any user (even anonymous users). All users can view every aspect of a quality gate.
To make changes (create, edit or delete) users must be granted the Administer Quality Profiles and Gates permission.
A project administrator can choose which quality gates his project is associated with. See Project Administration for more.
Defining Quality Gates
To manage quality gates, go to Quality Gates (top bar):
A quality gate is a set of conditions and a set of projects to be checked against these conditions.
Conditions can be set on measures (i.e. No blocker issues) or on deltas (i.e. No new blocker issues since previous version). Two thresholds can be set for each condition: warning and error.