Pull request decoration not happening in GitLab

Hello, I need help configuring SonarCloud which doesn’t add pull request decoration in GitLab.

  • SonarCloud organization bound to GitLab.com private group
  • CI system used : GitLab CI
  • Language : Java

Scanning is triggered in the merge request pipeline, using this Maven command :

mvn verify -B sonar:sonar -Dsonar.projectKey=${SONAR_PRJ} -Dsonar.organization=${SONAR_ORG}

The analysis runs and ends successfully, I can see the summary in the SonarCloud web UI under the project’s Pull Requests section. But I also get this warning in the top-corner :

The last analysis has a warning.
Pull request decoration did not happen. Provider ‘gitlab’ is not supported.

Indeed there isn’t any decoration published in the GitLab merge request activity. I expected to see an automated GitLab comment as described here : Pull request decoration

In the SonarCloud project adminstration, under General Settings / Pull Requests, when I try to select a provider manually, I only get two options : Azure DevOps Services and BitBucketCloud. Even though the project is bound to GitLab.

We also have the same behavior on our JavaScript projects configured as described in the documentation : GitLab CI / JS

Thanks to anyone who might help.

Hey there.

My only explanation right now is that somewhere (in a pom.xml file, in your pipeline file) you might have sonar.pullrequest.provider=gitlab configured, which is triggering some deprecated behavior from a time that Gitlab wasn’t supported.

Could you check for this string, sonar.pullrequest.provider , specifically?

Hello Colin, thank you for your answer.

I don’t have this parameter anywhere in the project nor pipeline configuration.

I also tried to explicitly pass -Dsonar.pullrequest.provider= or -Dsonar.pullrequest.provider=foo to the mvn verify command but I get the same warning message mentioning ‘gitlab’ provider.

Thanks.

I’m really stumped :thinking:

  • There was one case where a user received this message when using self-hosted gitlab (which isn’t supported on SonarCloud). That doesn’t sound like the case with you.
  • There was another case where a user received this message because they were analyzing a monorepo, but our Gitlab support includes monorepos today.

I’m going to reach out privately for your organization key and see what investigating we can do.

The problem was due to a missing binding between the SonarCloud project and the GtiLab project.

The repository binding can be configured in the SonarCloud project General settings.

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