TeamCity & SonarQube "Pull Request Analysis" integration - SONARQUBE_SCANNER_PARAMS details


Some posts in this community forum relates some difficulties to integrate “Pull Request Analysis” with TeamCity, mainly due to deal with scanner parameters execution.

I would like to improve this high value feature, and improve TeamCity SonarQube plugin as “first class citizen” about this integration. => #69.

The best way is to deal that with environment variables, filled depending environment execution (VCS/SCM properties, …). Analysing the SonarCloud & Travis integration, I discover the parameter SONARQUBE_SCANNER_PARAMS, nice ! very helpfull :slight_smile:.

For GitHub, I have the content, like:

SONARQUBE_SCANNER_PARAMS = { "sonar.pullrequest.key" : "1", "sonar.pullrequest.branch" : "branch", "sonar.pullrequest.base" : "master", "sonar.pullrequest.provider" : "GitHub", "sonar.pullrequest.github.repository" : "user-or-orga/some-repo", "sonar.organization" : "some-github-orga", "" : "" }

But to cover all providers on first implementation, I have some difficulties to retrieve all required parameters depending the provider (Pull Request Analysis doc is not explicit about them, parameters names are in SonarQube UI but not sure about values, I have not all Git platforms under the hand, …).

=> Is it possible to have some SONARQUBE_SCANNER_PARAMS snippet for Bitbucket / Gitlab / VSTS ?

I’m sure it is just a copy/past from your unit tests :smile: !

Many thanks :smiling_face_with_three_hearts:
Best regards

Snif, I will focus only on GitHub :sleepy: