TFS Branch and PR Analysis not working due to Unsupported PR provider 'tfsgit'

sonarqube
vsts

(Rycornell) #1

When running a scan against a branch or PR, a new branch is not created in the SonarQube IDE. There is a warning in the console output:

##[warning]Unsupported PR provider 'tfsgit'

This doesn’t happen all of the time. When it works, we’ve noticed that the PR provider is set to ‘TfsGit’. Looking at the vsts extension code here https://github.com/SonarSource/sonar-scanner-vsts/blob/3357e8f8ad0cf8ef28af34e90d4a5fc5a4ee9184/common/ts/prepare-task.ts#L86, it is doing a case-sensitive comparison:

if (provider === 'TfsGit') {

And so it doesn’t recognize tfsgit. Can the vsts extension be modified to do a case insensitive comparison? On our end, we’re looking into why that value is sometimes lowercase.

SonarQube DE Version 7.6 (build 21501)
VSTS Plugin Version 4.6.0


(Rycornell) #2

I submitted a PR to address this issue: https://github.com/SonarSource/sonar-scanner-vsts/pull/63