Looking for help with github comments

Sonarqube Developer Edition Version 7.2.1.
Running Integrated with MSBuild in Azure Devops (VSTS)

so we upgraded to the developer edition to use the multi-branch analysis which works great! however one thing that we lost was the github comments which decorated the PR’s. is it possible to use both at the same time? we tried it and recieved the following issue.

ERROR: Error during SonarQube Scanner execution
ERROR: A pull request analysis cannot have the branch analysis parameter ‘sonar.branch.name’

we got around the issue in the community edition by doing the following

if (PR)
prepare analysis with following params (sonar.pullrequest.base, sonar.pullrequest.branch, sonar.pullrequest.key)
msbuild
run code analysis

if (master)
prepare analysis (no params)
msbuild
run code analysis
publish quality gates

which apparently does not work anymore.

does anybody have any suggestions for doing both multi-branch for PR’s, and leaving the github comments as well?

Hi,

It looks like you’ve only done half the configuration. Go to Administration > Pull Requests and specify your provider and your personal access token.

 
Ann

we have verified that is correct. still same issue.

Hi,

I’m confused. Your screenshot shows GitHub configuration, but your initial post mentions “Azure Devops (VSTS)”. You for sure will not be able to annotate VSTS PRs with GH credentials. :slight_smile:

 
Ann

sorry i was not clear, we use Azure dev ops for CI/CD, and github for source.

Then this may be a permissions issue. Make sure the token you generated has push permissions.

 
Ann

Repo:All is correct yes? image

Hi,

That looks fine. Have you also set up the repository and endpoint? (https://docs.sonarqube.org/latest/analysis/pull-request/)

 
Ann

1 Like

ahh i missed the part about sonar.pullrequest.github.repository ans sonar.pullrequest.github.endpoint thanks @ganncamp !

2 Likes

I am taking over trying to get this to work from Michael. We followed the document you mentioned but we are still not seeing the nice inline comments on the github PR. Below are the advanced properties on the Prepare Analysis task in our Azure Devops (VSTS) Pipeline.

Any additional help would be appreciated.

Hi,

Those need to be defined at the global level in the UI. Decoration happens after scanner-side analysis, by which time values set on the analysis side aren’t available, as I understand it.

 
Ann

1 Like

Hi,
I found the problem. From your suggestion i went into the Administration > General > Pull Request settings on the SonarQube Project itself. That fixed out problem and we are getting inline comments on the github PR now from the analysis.
Thank you for the help @ganncamp

1 Like