Merge Request report not showing at gitlab.com

Hello everyone,

We are facing an issue with merge request decoration. After completing the initial configurations of our project and running our first test, we have noticed that a summary is not being displayed within the merge request. We have attempted several solutions, starting with generating a new token with the API scope, as well as trying different configurations, but nothing seems to work. We kindly request your support.

Additionally, I do have a question— the documentation mentions that a “technical” user with API scope is required, but I would like your guidance on the specific privileges that the “technical” user should have.

Here are some general details:

  • ALM used (Gitlab Plan)
  • CI system used (GitLab Pipelines)
  • Scanner command:
sonarcloud-check:
  stage: coverage
  before_script:
    - echo "Init sonarqube"
  needs:
    - job: test
      artifacts: true
  image:
    name: sonarsource/sonar-scanner-cli:11.1
    entrypoint: [""]
  script: |

    sonar-scanner -Dsonar.qualitygate.wait=true \
      -Dproject.settings="${SONAR_PROPERTIES_PATH}" \
      -Dsonar.go.coverage.reportPaths=./coverage.out \
      -Dsonar.projectKey=xxxxxx_${PROJECT_NAME} \
      -Dsonar.branch.name=$CI_COMMIT_REF_NAME 
       
  variables:
    SONAR_TOKEN: $SONAR_TOKEN
    SONAR_ORGANIZATION: $SONAR_ORG
    PROJECT_NAME: $CI_PROJECT_NAME
    SONAR_PROJECT_KEY: $SONAR_PROJECT_KEY
    SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"
    SONAR_PROPERTIES_PATH: "${CI_PROJECT_DIR}/sonar-project.properties"
    GIT_DEPTH: "0"
    JACOCO_COVERAGE_PATH: "coverage-report.out"
  cache:
    key: "sonarcloud-${CI_COMMIT_REF_SLUG}"
    paths:
      - .sonar/cache
  rules:
    - if: '$SONAR_ENABLED == "true" && ($CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH)'
      when: always
    - when: never

PD: Also we found some articles in the forum but nothing seems to solve the problem we are facing.

Hey there.

  • Is your project bound?
  • Do you see the Merge Request analysis in your SonarQube Cloud project?

Specifically, the user will need Reporter permissions. I’m not sure how this fell out of the SonarQube Cloud docs (it’s in the SonarQube server docs). I’ll raise that point.

Hi Colin,

Thank you so much for your support, yes the project is bounded but MR/PR analysis is not showing.

I can navigate into the report generated for each branch but nothing is showing at Gitlab into the MR.

About the technical user you are right it was into the server documentation.

Thank’s in advance!

In that case I’m guessing that because of some rule here, you aren’t getting a PR analysis when you raise the PR.

I’m not here to tell you what rules are wrong, but I would encourage you to try the default in our docs, raise a new PR and see if you get a PR analysis.

rules:
    - if: $CI_COMMIT_REF_NAME == 'main' || $CI_PIPELINE_SOURCE == 'merge_request_event'

Hi Colin,

Thanks for your response.

I’ll try the default configuration from the documentation, create a new PR, and check if the PR analysis runs correctly.

I’ll keep you posted on the results.

Thanks again for your help!