sonarqube-community-branch-plugin
sonarqube-community-branch-plugin copied to clipboard
[SQ8] Gateway summary but no individual code smell decoration on gitlab
Thank you for the wonderful work, that helped me for years 🥰
Describe the bug With Gitlab, the MR is decorated with quality gate status, but no individual code smell decoration. It used to work with SonarQube 8.4 and associated plugin version.
To Reproduce Classic usage with Gitlab
Expected behavior A way to know what's wrong, if this is a user misconfiguration
Screenshots
Sonarqube CE logs :
2022.07.19 09:35:05 INFO ce[AYIVz5HYJEFr3rsCCqQN][c.g.m.s.p.c.p.PullRequestPostAnalysisTask] using pull request decorator com.github.mc1arke.sonarqube.plugin.ce.pullrequest.gitlab.GitlabMergeRequestDecorator
2022.07.19 09:35:08 INFO ce[AYIVz5HYJEFr3rsCCqQN][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request Decoration | status=SUCCESS | time=3316ms
2022.07.19 09:35:08 INFO ce[AYIVz5HYJEFr3rsCCqQN][o.s.c.t.CeWorkerImpl] Executed task | project=minz | type=REPORT | pullRequest=1936 | id=AYIVz5HYJEFr3rsCCqQN | submitter=me | status=SUCCESS | time=5653ms
I did not find anything meaningful using DEBUG logs, so I won't paste them for now
Software Versions
- SonarQube Version: 8.9.9
- Plugin Version: 1.8.2
- Gitlab : gitlab.com (GitLab Enterprise Edition 15.2.0-pre [23631a9ae51])
I forgot to mention that this is a mono-repository, so one project on Gitlab side and multiple projects on SonarQube side. I tested by adding deliberate code smalls to 2 modules.
Although, I may use some outdated scanner fields :
sonar.pullrequest.key=$CI_MERGE_REQUEST_IID
sonar.pullrequest.branch=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
sonar.pullrequest.base=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
sonar.pullrequest.gitlab.instanceUrl=$CI_API_V4_URL
sonar.pullrequest.gitlab.projectId=$CI_PROJECT_PATH
sonar.pullrequest.gitlab.projectUrl=$CI_MERGE_REQUEST_PROJECT_URL
com.github.mc1arke.sonarqube.plugin.branch.pullrequest.gitlab.pipelineId=$CI_PIPELINE_ID
sonar.scm.revision=$CI_COMMIT_SHA
The fact you're getting the Quality Gate status indicates the ability to post a summary comment is ok. I'd expect a failure to post a 'diff' comment would cause an error in your logs, so would need to see either your debug-level logs, or an example Merge Request that I can try and replicate the issue is with myself
Thank you for your time.
An example MR to show would be too complicated as of now, so here are debug logs : sonarqube_ce(13).log
Does it help ?
Hey @bcouetil, we recently updated from GitLab 14.4.x to 15.3.x and SonarQube from 9.5 to 9.6.x and facing the same issue you described. Do you still have the issue or any solution?
Unfortunately no solution as of now...
I guess @mc1arke has not found time to dig into this for now...
Anyone coming to this issue knows a working version ?
I have exactly same issue with Sonar 8.9 and BB 7.18. No signs of error on sonar plus I can see branch and PR analysis on Sonar but no decoration on BB PR page.
Someone gave me a recent working couple in issue #678
The latest this bundle has is sonar 9.5.0 unless you have your own docket image pulling 9.6.1 sonar with latest pull request community plugin
Ok update is I got it working Sonar 9.6.1, Community plug-in 1.12.0. Couple of gotchas but ended up well. Have raised a PR as well to make it easier for next guy
We had similar issue in our project, only summary without individual comments. The problem was in the setup, Administration -> ALM Integrations -> GitLab URL (sonar.auth.gitlab.url
) needs to be https://gitlab.com/, not https://gitlab.com/api/v4/.