Cannot Use Merge Request Decoration Without Setting Configuration

Hello,

I am trying to use MR decoration via SonarQube Developer Edition, Version 8.9.

I followed the steps that are documented in Decorating Pull Requests | SonarQube Docs. I have set my global settings in SonarQube Administration Page.

If I run the CI Merge Request pipeline, MR decoration does not work. But, If I select the Configuration in project/settings?category=pull_request_decoration_binding&id=PROJECT_NAME, MR decoration works. We have many projects in our ALM (25-30 projects). Is it reqiured for MR Decoration to manually set the Project ALM Configuration via Project Settings - General - Pull Request Decoration? Is there an automated way of doing this?

Here is my GitLab CI file via dotnet-sonarscanner.

SonarQube Merge Request Analysis:
  stage: Test
  only:
    - merge_requests
  script:
    - dotnet test 
      /p:CollectCoverage=true 
      /p:CoverletOutputFormat=opencover 
      --no-restore
    - dotnet-sonarscanner begin
      /k:$SONAR_PROJECT_NAME
      /n:$SONAR_PROJECT_NAME
      /d:sonar.host.url=$SONAR_HOST_URL
      /d:sonar.login=$SONAR_USER
      /d:sonar.password=$SONAR_PASS
      /d:sonar.cs.opencover.reportsPaths="./tests/coverage.opencover.xml"
      /d:sonar.exclusions=".nuget/**"
    - dotnet build --no-restore
    - dotnet-sonarscanner end
      /d:sonar.login=$SONAR_USER
      /d:sonar.password=$SONAR_PASS
  allow_failure: false
  variables:
    SONAR_PROJECT_NAME: $CI_PROJECT_NAME
    GIT_DEPTH: 0

Thank you!

Must-share information (formatted with Markdown):

  • Developer Edition, Version 8.9 (build 43852), dotnet-sonarscanner latest.
  • MR decoration.
  • Manually set ALM Configuration via project/settings?category=pull_request_decoration_binding&id=PROJECT_NAME.

Hi @dogac_akyildiz, welcome to the SonarSource Community!

That’s a popular question today. I just answered a similar one a few moments ago.

Thank you @Jeff_Zapotoczny.

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