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 208 forks source link

Build failed on publish mode #257

Open ovidals opened 4 years ago

ovidals commented 4 years ago

Hi, I'm using sonar-gitlab-plugin V7.6.

When I scan my project on preview mode, the job succeed correctly, but when I merge the code on master and rerun sonar-scanner on publish mode it fails.

On publish mode, sonar-scanner is detecting all bad code from the project, so it fails.

Here is my calls:

Job ends correctly on MR before merge:

- gitlab-sonar-scanner -X -Dsonar.analysis.mode=preview -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$GIT_BRANCH -Dsonar.gitlab.project_id=$CI_PROJECT_ID

Report status=success, desc=SonarQube reported no issues 12:55:22.507 INFO: Analysis total time: 5.282 s 12:55:23.265 INFO: ------------------------------------------------------------------------ 12:55:23.265 INFO: EXECUTION SUCCESS 12:55:23.265 INFO: ------------------------------------------------------------------------

Job fails after merge:

- gitlab-sonar-scanner -Dsonar.analysis.mode=publish -Dsonar.gitlab.quality_gate_fail_mode=none -Dsonar.gitlab.disable_inline_comments=true -Dsonar.gitlab.disable_global_comment=true -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$GIT_BRANCH -Dsonar.gitlab.project_id=$CI_PROJECT_ID

EXECUTION FAILURE 17:04:55.429 INFO: ------------------------------------------------------------------------ 17:04:55.430 INFO: Total time: 2:43.548s 17:04:55.499 INFO: Final Memory: 12M/122M 17:04:55.499 INFO: ------------------------------------------------------------------------ 17:04:55.499 ERROR: Error during SonarQube Scanner execution 17:04:55.499 ERROR: Report status=failed, desc=SonarQube reported QualityGate is ok, with 3 ok, 1277 issues, with 7 blocker (fail) and 728 critical (fail) and 278 major and 223 minor and 41 info

LiewJK commented 4 years ago

Hi, may I know are you using the [ciricihq/gitlab-sonar-scanner] image in your gitlab-ci.yml? thanks

ovidals commented 4 years ago

Hi, may I know are you using the [ciricihq/gitlab-sonar-scanner] image in your gitlab-ci.yml? thanks

Yes LiewJK.

LiewJK commented 4 years ago

Hi, may I know are you using the [ciricihq/gitlab-sonar-scanner] image in your gitlab-ci.yml? thanks

Yes LiewJK.

Thanks

ndesai15 commented 4 years ago

Is there any special configuration require to use this plugin? While running sonar-scanner, it throws an error of sonar-scanner command not found

LiewJK commented 4 years ago

Is there any special configuration require to use this plugin? While running sonar-scanner, it throws an error of sonar-scanner command not found

you have to use [ciricihq/gitlab-sonar-scanner] image

ndesai15 commented 4 years ago

Thanks for your reply. Is it mentioned anywhere in official documentation of this plugin?

LiewJK commented 4 years ago

Thanks for your reply. Is it mentioned anywhere in official documentation of this plugin?

I'm not sure.. I just doing browse through the community support and get the solution. Hope its help.