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

CAN'T disable Issues Gate #142

Open dungdm93 opened 6 years ago

dungdm93 commented 6 years ago

I want to disable all Max Issues Gates to make Quality Gate is only criteria to make the status fail. But I got bellow error while try to set sonar.gitlab.max_blocker_issues_gate=-1 screenshot from 2018-05-27 22-12-51 The same problem is occur when set sonar.gitlab.max_major_issues_gate=-1 which has default value is -1

NOTE: I'm hacking on database, and manual change sonar.gitlab.max_blocker_issues_gate to -1. Then It' work!!! :muscle: :muscle: :muscle:

QUESTION / FEATURE REQUEST: Is there any (future) function to allow me disable Max Issues Gates by default (for all projects), without hacking like that: screenshot from 2018-05-27 22-50-31

gentunian commented 6 years ago

@dungdm93 I can't find that option. Which version are you using?

dungdm93 commented 6 years ago

@gentunian Sonar GitLab Plugin: 3.0.0

gabrie-allaigre commented 6 years ago

Hi, In command line to set sonar.gitlab.max_major_issues_gate=-1 Is simple ? no ?

gentunian commented 6 years ago

@gabrie-allaigre yes, I was looking in the wrong place :)

dungdm93 commented 6 years ago

@gabrie-allaigre I have a lot of repos, so I should duplicate that option everywhere :'(

gabrie-allaigre commented 6 years ago

@dungdm93 what is the need? Because the principle of the plugin is precisely crash if a problem. Otherwise for the moment it is to put a big value in the fields 99999

dungdm93 commented 6 years ago

@gabrie-allaigre You misunderstood. As administrator perspective, I want that command as simple as possible, one extra option can make my developers confuse. Moreover, that option can be set via command line, why can NOT be set globally on server?

gentunian commented 6 years ago

@gabrie-allaigre I'm confused also. I'm getting quality gate failed for minor issues too:

[INFO] Quality gate status: ERROR
[ERROR] Open Issues: 9 > 0
[INFO] Reopened Issues : 0
[INFO] Report status=failed, desc=SonarQube reported QualityGate is error, with 1 error and 1 ok, 9 issues, with 9 minor

I've ran the pipeline with this config:

code analysis :
  stage: analysis
  except:
    - master
  script:
    - mvn clean install --batch-mode sonar:sonar
        -Dsonar.java.binaries=${PWD}
        -Dsonar.projectName=${CI_PROJECT_PATH}
        -Dsonar.projectKey=project${CI_PROJECT_ID}
        -Dsonar.gitlab.project_id=${CI_PROJECT_PATH}
        -Dsonar.gitlab.commit_sha=${CI_COMMIT_SHA}
        -Dsonar.gitlab.ref_name=${CI_COMMIT_REF_NAME}
        -Dsonar.branch.name=${CI_COMMIT_REF_NAME}
        -Dsonar.gitlab.unique_issue_per_inline=true
        -Dsonar.gitlab.max_blocker_issues_gate=-1
        -Dsonar.gitlab.max_critical_issues_gate=-1

and I've set this in sonarqube:

selection_201

gabrie-allaigre commented 6 years ago

@gentunian max_..._issues_gate is only for preview mode, Else use quality gate https://github.com/gabrie-allaigre/sonar-gitlab-plugin/issues/165#issuecomment-416525159

gentunian commented 6 years ago

@gabrie-allaigre thanks for the info, I've created this #167

gabrie-allaigre commented 6 years ago

@gentunian Thanks