GitHub PullRequest Decoration

Hi,
We are using SonarQube 7.4 Enterprise version and trying to use pullrequest decoration first time.
But the pull request decoration is not happening and I am seeing below warning from SonarQube UI.

Pull request decoration did not happen. Please provide a Pull Request Github Authentication token in the project’s or global settings.

I am using below sonar properties from Jenkins pipeline.

withSonarQubeEnv(‘SonarQubeEE’) {
sh ‘$SONARSCANNER/bin/sonar-scanner -Dsonar.projectKey=soanr-decorartion
-Dsonar.projectName=soanr-decorartion
-Dsonar.sources=account/src
-Dsonar.java.binaries=account/build/
-Dsonar.pullrequest.github.repository=scm-og/jenkins-upgrade-test
-Dsonar.pullrequest.branch=origin/test-sonar
-Dsonar.pullrequest.key=$PR_NUMBER
-Dsonar.pullrequest.base=master
-Dsonar.pullrequest.github.endpoint=“GitHub API”
-Dsonar.pullrequest.github.token.secured=GH_ACCESS_TOKEN’

Also, do I need to create GitHub App to use PullRequest decoration, I have not created any GH app and trying to get the Sonar Analysis status back in PR checks.

Please help me to fix this issue.

Regards,

Jagadeesh

Hey Jagadeesh,

The minimum supported version of SonarQube is v7.9 LTS. You should upgrade at your earliest convenience.

Documentation for Pull Request Analysis in v7.4 is located here: https://docs.sonarqube.org/7.4/analysis/pull-request/.

A GitHub App wasn’t required at this time, but as your error indicates, you must provide a Github Authentication token in the project’s or global settings (in the UI, under project or global Administration > Pull Requests). This cannot be provided as an analysis paramter.

Don’t get too married to this setup though, as it changes a lot in v7.9 LTS.

An upgrade sooner than later is really worth your time if you want to start using Pull Request Decoration. I’m also pretty sure that this early iteration of Pull Request Decoration “just” adds issues as comments to your PR, not adding anything to your PR Checks.

Hello Colin,

Thanks a lot for the update. I have the TOKEN added from Global Settings in Sonar UI but for some reason its not working.

As you recommended, I will try to upgrade Sonar to latest version and then try implementing Sonar Decoration.

Could you please share me the sonar upgrade documentation? Also, Can I upgrade to latest version of the Sonar from 7.4. Please confirm.

Regards,

Jagadeesh