We have a project in GitHub (private repo). It’s built with CircleCI. But we tried to run sonarqube scan locally with the same results.
The analysis in Sonarcloud gets created successfully, but PR decoration fails. Sonarcloud shows the following warning message:
Pull request decoration did not happen. Please install SonarCloud Github application on the repository's organization or user.
Of course, we double-checked - the GitHub application for the repository is installed.
The scan is run with Gradle sonarqube plugin. The plugin version is 2.7, tried also with 2.8, which is the latest currently.
There is a newer project in the same GitHub org, same Sonarcloud org, scanned and analyzed in Sonarcloud in almost the same way, for which the PR decoration works fine.
That is unexpected behaviour, can you please check that the Github app that is installed on your organization has access to all the repositories in your organization? You can do that by going to Settings > Applications > SonarCloud > Repository Access.
The SonarCloud GitHub app has access to all the repos it’s relevant for, including the problematic one.
Also, while trying to resolve the problem, I gave it access to ALL repos in the organization. It didn’t help.
Did you import the project that is failing through GitHub (do you see a GitHub icon next to the project name)? Or do you manually set the property sonar.pullrequest.github.repository somewhere in your CircleCI build?