PR Decoration in GitHub

github
pull-request
(Ben) #1

Hello!

I am using a trial of SonarQube Developer Edition 7.7. I am attempting to configure Pull Request decoration for a GitHub repository, but it does not appear to be working.

I am still running my instance of SonarQube locally, per the instructions here:
https://docs.sonarqube.org/latest/setup/get-started-2-minutes/

I have also read through the pull request instructions here:
https://docs.sonarqube.org/latest/analysis/pull-request/

Per these instructions, I have done the following:

  • In the Global > Administration > Pull Requests tab, I have set the following values:
    • sonar.pullrequest.provider
    • sonar.alm.github.app.name
    • sonar.alm.github.app.id
    • sonar.alm.github.app.privateKey.secured
    • Note: I did not set sonar.pullrequest.github.endpoint, as I am not using GitHub Enterprise
  • In my project’s Administration > Pull Requests tab, I have set the following values:
    • sonar.pullrequest.provider
    • sonar.pullrequest.github.repository
  • When I run the SonarScanner begin command, I append the following parameters:
    • sonar.pullrequest.key
    • sonar.pullrequest.branch
    • sonar.pullrequest.base
    • sonar.github.oauth

When I do this, the SonarQube page does correctly reflect the changes in the pull requests, but I do not see the decorations on GitHub as expected. What additional information do I need to configure?

(Lorenzo Bettini) #2

I think that’s related to Pull Request on GitHub is not decorated as expected

(Ben) #4

Thanks for the feedback! It sounds similar, but I am not using SonarCloud; I read some of the documentation you linked, but it doesn’t seem to be the same for my on-prem situation, unless I am misunderstanding something.

(Benoit) #5

Well, you must set this property otherwise it won’t work.
In previous version of SonarQube we default to https://api.github.com if this property was not set, but we remove that because we don’t (and never have) officially supported Github.com with SonarQube.

So you have to set the property to https://api.github.com instead of a GitHub Enterprise url, but be aware that it’s not (yet) officially supported (see previous link to understand why).

HTH
Benoit