Search code examples
tfssonarqubeazure-devopssonarqube-scan

TFS SonarQube Extension is not sending comments to pull requests for JS files


I'm using Visual Studio Team Foundation Server 2015 with SonarQube extension.

It's commenting to pull requests for .cs files but not commenting on JavaScript (jsx) files. When I check the report on the dashboard I can see comments for JS files, so it means, the scanner is analyzing JS files correctly but I couldn't understand why it's not sending comments to pull request.

How can I set it up to command for JS files too?

UPDATE: This is my build definition which linked to pull requests:

1) SonarQube Scanner for MSBuild - Begin Analysis (new)
2) Visual Studio Build (solution of our project)
3) npm install
4) npm run build
5) SonarQube Scanner for MSBuild - End Analysis (new)

As you see there are 2 different projects in the same folder. One of them is .NET project (step 2), another one is a NodeJS project (step 3-4).


Solution

  • PR decoration in TFS/VSTS (i.e. adding comments and updating the status of a PR) used to be supported only for projects built with the Scanner for MSBuild, and with quite some limitations (what you are experiencing is probably one of them).

    As a consequence, the support of PR decoration has been removed in the latest version of the TFS/VSTS extension.

    We are now working on a proper support of PR decoration, that will work for any project (.NET, Java, JS, ...etc). We are planning to roll this out first on SonarCloud (using the SonarCloud VSTS extension), and in a couple of month on SonarQube (using the SonarQube TFS/VSTS extension).