gitlabsonarqubesonarqube-scandotnet-cli

Pull request decoration is not working in SonarQube with Gitlab


we have SonarQube integrated with Gitlab. Sonarqube version : 8.8

everything is working except the PR decoration. we have enabled the below settings in project configuration to enable PR decoration:

Configuration name 

Project ID 

we are analyzing code using following command

dotnet sonarscanner begin -k:$CI_PROJECT_PATH_SLUG -d:sonar.qualitygate.wait=$SONAR_GATE -d:sonar.gitlab.commit_sha=$CI_COMMIT_SHORT_SHA -d:sonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -v:$CI_COMMIT_REF_NAME -d:sonar.login=$SONAR_TOKEN -d:sonar.host.url=$SONAR_URL -d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" -d:sonar.coverage.exclusions="**/*Tests*" -d:sonar.cs.vstest.reportsPaths="**\*.trx"

and

dotnet sonarscanner end -d:sonar.login="$SONAR_TOKEN"

after referring doc : https://docs.sonarqube.org/latest/analysis/pull-request/ its revealed that , no need to set any parameter manually, sonarqube auto detect and set those.

after analyzing code, we still not able to see PR decoration. not sure why ? Please suggest


Solution

  • Its fixed. The issues was MR decoration was not enabled in Gitlab yaml file. https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html#configure-pipelines-for-merge-requests