Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-4366

Introduce a new "Quality Gate" concept to handle alerts independently from quality profiles



    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3
    • Component/s: Quality Gate
    • Labels:


      In Sonar, alerts are designed to define "quality gates" (= quality requirements at project level). However, alerts are currently linked to quality profiles, and so cannot be defined globally to be shared/reused amongst different quality profiles/languages. Alerts should therefore be independent from quality profiles and they should exist in a dedicated space.

      From a user point of view, here's how this should behave:

      • a new "Quality Gates" space should be available, with the following actions ("Administer QP" permission is required for all create/update operations):
        • create a new QG, given:
          • a name
        • list all available QG
        • delete a QG, given:
          • its name
        • rename a QG, given:
          • its name
        • set a QG as the default QG (should replace the default one if it exists), given
          • its name
        • unset the default QG (it should be possible to have no default QG), given
          • its name
        • display a QG (given its name):
          • "Requirements" tab (main one):
            • list all its requirements
            • add a new requirement, given:
              • a metric name
              • an optional period
              • an operator
              • a warning threshold
              • an error threshold
            • remove a requirement, given:
              • its ID
            • update an existing requirement, given:
              • its ID
              • a metric name
              • an optional period
              • an operator
              • a warning threshold
              • an error threshold
          • "Projects" tab:
            • list all projects specifically associated to the QP (given its name)
            • (un)associate projects to this QG (using the same UI as for management of users/groups)
              • same kind of WS as for management of users/groups
        • copy a QG, given
          • its name
      • on a project settings, turn the "Quality Profiles" entry into "Quality Settings" and add the ability to set the QG to use for the project:
        • Given its key and a QG name
        • Should be listed as available:
          • all existing QG
          • "Default"
          • "None"
      • when running an analysis on a given project, if this project has a quality gate:
        • execute all the requirements
        • at project level, we should keep the "alert" measure that tells if a project has met or not a quality gate, and feed it accordingly
      • the "Alerts" tab should disappear from the "Quality Profile" space
      • the "Administer QP" permission should be updated (name and description)

      Note: a new "Quality Gate" widget will be available at project level (see SONAR-4927).

      Technically speaking, some details we must pay attention to:

      • if set, the default QG should be stored in the "sonar.qualitygate" property (but this property must not be displayed in the Global Settings)
      • if set on a project, its QG should also be stored in the "sonar.qualitygate" property (maybe with a "none" value when overriding the default QP defined at global level)
      • at the very end of the sprint, make a migration scripts to, create a QG gate for each QP that has alerts (with a name like "QP_name - QP_language")
        • try to be smart enough to set the default QG (if the default QP had alerts)
        • try to be smart enough to associate projects to the new QG if they were associated to the corresponding QP


          Issue Links

          There are no Sub-Tasks for this issue.



              jb.lievremont OLD - Jean-Baptiste Lièvremont (Inactive)
              fabemn OLD - Fabrice Bellingard
              1 Vote for this issue
              3 Start watching this issue