Pull request decorations in GitLab "successful" but not showing up

Using SonarQube 8.6.0 with the latest SonarScanner, integrated with GitLab 13.5.3 (self-hosted).

Trying to get Pull Request decoration functional and the logs indicate it is working, but nothing shows up in the GitLab merge request.

From the sonarqube_ce.log log file:

2020.12.19 02:37:09 INFO  ce[AXZ425p3PF5_SiqdhXmK][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request decoration | status=SUCCESS | time=0ms

Any suggestions to figure out what’s going wrong or where it’s failing?

Hello @gavinmroy,

Welcome to the SonarSource community. :wave:. I hope you’ll enjoy it.
Could you

  • activate DEBUG log level on your SonarQube (menu Administration --> System, then logs level top right)
  • Run a scan with a PR analysis
  • Send the full ce.log file
  • Revert logs to INFO

Attached the full context of logs post level change to DEBUG. Alas it does not look like there are debug level logs showing up for the pull request decoration behavior.

ce.log (32.1 KB)

Capturing TRACE level logs.

Found it in trace logs:

2020.12.21 16:19:02 TRACE ce[AXaGGMpDF1Eq79Iegrc3][c.sonarsource.E.D.c] ProjectAnalysis is not a pull request. Not decorating.
2020.12.21 16:19:02 INFO ce[AXaGGMpDF1Eq79Iegrc3][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request decoration | status=SUCCESS | time=0ms

I’m wondering if it has something to do with the sonarscanner image we’re using - digging down that path.

OK, that helps.
First thing first, do you see the branch or PR reported in SonarQube UI ?

The type of analysis is determined by a certain number of of analysis parameters that are detected only if you use GitLab-CI or Jenkins
See: https://docs.sonarqube.org/latest/analysis/gitlab-integration/#header-4 for GitLab-CI sample YAML files
For Jenkins, you have to configure a multibranch pipeline with the GitLab branch source plugin installed

Outside of GitLab-CI and Jenkins, you cannot decorate PRs in gitlab.

Olivier

Branch is in SonarQube - problem was not specifically creating a new test stanza for MRs only and not calling out the only: [merge_requests] section in the config. Currently waiting on a pipeline to finish, but 99% sure that was the issue.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.