We would like to setup Github Checks (PR decorations?). But we use different organizations between SonarCloud and GitHub. I can’t link these organizations.
Is that possible to setup GitHub Checks matching just GitHub repository + Sonar project?
It is possible if you create an organization (and projects) manually, instead of importing them from GitHub (by clicking on the “Create manually tab” on the organization creation page. But I would not recommend to go with this feature as we’re planning to remove it in the not-too-distant future.
Could you clarify why you need different Organization between SonarCloud and GitHub? Why can’t you simply import your GitHub org in SonarCloud?
That would help me guide you with the best solution.
I’ve already created a project manually and send scanned results from CI successfully. Now I’m stuck with decorating PRs in github. Could you please assist with that part?
The reason for this is we work with different clients and want to own (and pay) SonarCloud organization ourselves. Where for this particular project the github organization with repositories is owned by our client. That’s why we would like to link only the repo+project rather than organizations.
We don’t want to commit the client to the paid SonarCloud plan at that point, as we want to make a test run for a few months.
Thanks for the explanation, it’s always useful for us to understand use cases of users.
In Administration > General Settings > Pull Request > Integration with GitHub you can set the slug of the GitHub project. That and installing the SonarCloud GitHub app on your repository should be enough to have PR decoration working. But please keep in mind that this manual configuration may be removed in the future.
Do you see any warning on the top right corner of a PR dashboard on SonarCloud?
Usually if PR decoration failed, you should get a message with the reason of the failure.
Thanks for the hint! There are two warnings indeed:
The SonarCloud GitHub application is installed on your GitHub organization, but the SonarCloud organization is not bound to it. Please read “How to bind an existing organization?” section in the “Organizations” documentation page to fix your setup.
Pull request decoration did not happen. No commit found for revision ‘98e843c32f8612e0d6fa26f62e987a4532cd764b’. Please pass a valid commit revision to the scanner using ‘sonar.scm.revision’ parameter.