Cannot get pull request decoration to work

We have a project on GitHub and it is under different organisation than the one in SonarCloud. Using standalone Sonar client for analysis and submitting results. The analysis works ok, but we cannot get it to decorate a pull request.

We use CloudBees Jenkins with multi-branch setup for pull requests with merging to the parent branch.

We set the following additional properties:

  • sonar.pullrequest.key (say 130, the number of PR)
  • sonar.pullrequest.branch (say my-wip-branch)
  • sonar.pullrequest.base (say trunk)
  • sonar.pullrequest.provider (GitHub)
  • sonar.pullrequest.github.repository (say my-gh-account/my-project)
  • sonar.scm.revision (a full commit sha of the last commit in the repo on the branch)
  • sonar.pullrequest.github.endpoint (https://api.github.com)

I don’t know what I’m doing wrong, there are no warnings or error messages, basically no any information what went wrong.

Welcome to the community!

To understand what’s happening, I’d like to clarify a few things.

  • We have two kinds of decoration on PRs: a Check and summary comment. Are they both missing? (The summary comment is enabled by default, unless you have explicitly disabled in the project settings. Please check that!)

    • The decoration with GitHub Checks is specific to a commit. It uses the commit of the Git working tree where the analysis was executed. When the commit of the working tree does not match the tip of the pull request, then it will not be visible on the pull request. To verify the commit that is decorated, you can add a git log -n1 command before executing the analysis.
    • The decoration with summary comment is specific to the pull request. The commit of the Git working tree doesn’t matter for this one, it should add the comment for the specified pull request. (It’s more rare to have problems with this type of decoration than with Checks.)
  • Why do you use sonar.scm.revision? Normally this should not be needed. Do you have a specific reason to pass this parameter? Can you try an analysis without passing this?

Hi, We’re also trying to get PR decoration to work. Does the github action support in-line decoration (e.g commenting on the lines of code which has the issue?)

Or is the inline part just not supported on SonarCloud?