javamachr / 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
121 stars 21 forks source link

Global comment on merge request #36

Open moreorover opened 1 year ago

moreorover commented 1 year ago

Versions used:

GitLab 15.11 SonarQube 9.9.1 Sonar Gitlab Plugin 5.3.0

GitLab cicd pipeline is triggered on the merge request to main branch by the following command:

...
  script:
    - |
      mvn sonar:sonar \
      -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA \
      -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME \
      -Dsonar.gitlab.user_token=$TECHNICAL_USER_GITLAB_TOKEN \
      -Dsonar.gitlab.project_id=$CI_PROJECT_ID \
      -Dsonar.login=$SONARQUBE_TOKEN
...

Job proceeds to log the following:

image

And Sonar Qube reports shows the following

image

However, the global comment does not list the issues with the links to the code as per default global comment.

image