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

SonarQube step in GitLab should be able to check Quality Gate status

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.1
    • Component/s: Scanner
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      For GitLab, we'll implement a mechanism to wait and fail the SonarQube check when the Quality Gate is red.

      We'll implement this mechanism in the Scanner, thanks to additional options for scanner:

      • sonar.qualitygate.wait=false - enable/disable a scanner wait for QG result (value set to `false` if not specified)
      • sonar.qualitygate.timeout=300 (s) - set a time in seconds for how long scanner should wait for report to be processed (property is taken into account only if sonar.qualitygate.wait is set to `true`)

      For this, we'll add a step to scanner engine step just after report is published, so that the step can use values from properties to actively poll CE task endpoint (api/ce/task) for status within given time.

      • If task has success status, get Quality Gate status using api/qualitygates/project_status endpoint, otherwise (failed, canceled) stop processing with appropriate reason.
      • In case status pending/ in_progress continue polling until timeout is reached.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jacek.poreda Jacek Poreda
              Reporter:
              jacek.poreda Jacek Poreda
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: