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
712 stars 207 forks source link

build not failed on preview mode #272

Open appzone opened 4 years ago

appzone commented 4 years ago

hi, my maven build not failed when using preview mode with properties

sonar.gitlab.max_blocker_issues_gate 
sonar.gitlab.max_critical_issues_gate
sonar.gitlab.max_major_issues_gate

full parameter is

-Dsonar.host.url=<<URL>> -Dsonar.login=******* -Dsonar.analysis.mode=preview -Dsonar.report.export.path=report.json -Dsonar.gitlab.commit_sha=<<COMMIT_SHA>> -Dsonar.gitlab.ref_name=<<REF_NAME>> -Dsonar.gitlab.project_id=<<PROJECT_ID>> -Dsonar.gitlab.user_token=******* -Dsonar.gitlab.merge_request_discussion=true -Dsonar.gitlab.max_blocker_issues_gate=0 -Dsonar.gitlab.max_critical_issues_gate=0 -Dsonar.gitlab.max_major_issues_gate=0

the log from maven is

08:22:23
    [INFO] Sensor SurefireSensor [java]
08:22:23
    [INFO] parsing [/home/buildagent/app/work/38d2f8115718eaef/target/surefire-reports]
08:22:23
    [INFO] Sensor SurefireSensor [java] (done) | time=82ms
08:22:23
    [INFO] Sensor JaCoCoSensor [java]
08:22:23
    [INFO] Analysing /home/buildagent/app/work/38d2f8115718eaef/target/jacoco.exec
08:22:23
    [INFO] No information about coverage per test.
08:22:23
    [INFO] Sensor JaCoCoSensor [java] (done) | time=123ms
08:22:23
    [INFO] Sensor JavaXmlSensor [java]
08:22:23
    [INFO] 1 source files to be analyzed
08:22:23
    [INFO] Sensor JavaXmlSensor [java] (done) | time=130ms
08:22:23
    [INFO] Sensor HTML [web]
08:22:23
    [INFO] 1/1 source files have been analyzed
08:22:23
    [INFO] Sensor HTML [web] (done) | time=13ms
08:22:23
    [INFO] Sensor XML Sensor [xml]
08:22:23
    [INFO] 1 source files to be analyzed
08:22:23
    [INFO] Sensor XML Sensor [xml] (done) | time=145ms
08:22:23
    [INFO] 1/1 source files have been analyzed
08:22:23
    [INFO] ------------- Run sensors on project
08:22:23
    [INFO] No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
08:22:23
    [INFO] Load server issues
08:22:23
    [INFO] Load server issues (done) | time=18ms
08:22:23
    [INFO] Performing issue tracking
08:22:24
    [INFO] 19/19 components tracked
08:22:24
    [INFO] Load server rules
08:22:24
    [INFO] Load server rules (done) | time=111ms
08:22:24
    [INFO] Export issues to /home/buildagent/app/work/38d2f8115718eaef/target/sonar/report.json
08:22:24
    [INFO] ANALYSIS SUCCESSFUL
08:22:24
    [INFO] Executing post-job 'GitLab Commit Issue Publisher'
08:22:27
    [INFO] Report status=failed, desc=SonarQube reported 4 issues, with 3 blocker (fail) and 1 major (fail)
08:22:27
    [INFO] Analysis total time: 9.704 s
08:22:27
  [Maven Watcher] 
08:22:27
  [INFO] ------------------------------------------------------------------------
08:22:27
  [INFO] BUILD SUCCESS
08:22:27
  [INFO] ------------------------------------------------------------------------

plugin version 4.1.0-SNAPSHOT sonar version 7.6.0.21501   expected the build is failed