gabrie-allaigre / sonar-gitlab-plugin

Add to each commit GitLab in a global commentary on the new anomalies added by this commit and add comment lines of modified files
GNU Lesser General Public License v3.0
713 stars 207 forks source link

Ignore Quality Gate for Branch Analysis #204

Open lfojacintho opened 5 years ago

lfojacintho commented 5 years ago

Hey there,

I'm using Sonarqube 7.3 Developer Edition (with branch plugins) and I use this plugin (version 4.0.0) to report the issues introduced in a Merge Request directly into GitLab.

It works great, but as we know, Sonarqube branch plugin has some limitations, like a hardcoded Quality Gate for short-lived branches (https://docs.sonarqube.org/7.4/branches/short-lived-branches/).

I want to avoid the merge on GitLab if the pipeline is broken, but I would like to break the pipeline only with a customised Quality Gate (let's say, no BLOCKER or CRITICAL, but allow up to 3 MAJOR issues).

I know I can configure that limits (like setting sonar.gitlab.max_blocker_issues_gate), but it works only with preview mode, and if you have any issue (even a INFO), the hardcoded Quality Gate will break the build.

I'd like to introduce a new parameter to the plugin (let's say sonar.gitlab.ignore_quality_gate=true) that ignores the Quality Gate status when reporting the pipeline status to GitLab.

Cheers

lfojacintho commented 5 years ago

Thinking better on this issue, there's already a property to set the Quality Gate Failure Mode. Currently, the supported options are ERROR and WARN. What about this property support the mode NONE, so the Quality Gate is ignored for breaking the build.