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

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 sonar-scanner-vsts/prepare-task.ts at 3357e8f8ad0cf8ef28af34e90d4a5fc5a4ee9184 · SonarSource/sonar-scanner-vsts · GitHub, 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

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

Hi Ryan,

Thanks for the time you invest providing us a pull request, and sorry for the late reply.

Have you manage to find out why this Build.Repository.Provider sometimes is set to 'tfsgit' ? Do you still encounter the issue ?

According to the documentation it should always be 'TfsGit'.

Regards