On SonarQube Community Build projects bound to their GitLab repository, SonarQube Community Build automatically sets up the report of your quality gate status and analysis metrics directly to your GitLab merge requests. For unbound projects, you must set up the quality gate status report manually as explained below (The integration of SonarQube Community Build with GitLab must be properly set up).
To report your quality gate status in GitLab for unbound projects:
In the SonarQube Community Build UI page of your project, select Project Settings > General Settings > DevOps Platform Integration.
SonarQube Community Build can provide feedback about security vulnerabilities inside the GitLab interface itself. The security issues found by SonarQube Community Build will appear on the Gitlab > Vulnerability report page.
Initially, all issues of type Vulnerability marked Open on SonarQube Community Build are marked as Needs triage on GitLab. When you update the status of an issue in SonarQube Community Build, it is also updated in GitLab. Updating the status of an issue in Gitlab does not update it in SonarQube Community Build.
If issues in GitLab appear duplicated after a modification, users should use the Activity > Still detected filter.
Correspondence of statuses
Because the available statuses on the two systems are not exactly the same, the following logic is used to manage the transitions:
In SonarQube, a transition to
Results in this in GitLab
Open
Needs triage
Confirmed (deprecated)
Confirm
Accepted
Dismiss
Fixed
Resolved
Severity mapping
The following table presents the mapping of the severity levels between SonarQube Community Build and GitLab.
The report is set up through your GitLab CI/CD pipeline. The user starting the analysis in the pipeline must have the Browse permission on your project. This user corresponds to the SonarQube Community Build account used to generate the analysis token in Adding the SonarQube Community Build analysis to your GitLab CI/CD pipeline.
Proceed as follows:
Add a vulnerability report stage to your .gitlab-ci.yml file, as follows:
SonarScanner for GradleSonarScanner for MavenSonarScanner CLISonarScanner for .NET