0
votes

Currently I'm trying to integrate TFS 2015 with SonarQube but with no result, the situation is that no where it is mentionned how to update the build agent to take the SonarQube.MSBuild.Runner into consideration. When i started integrating the two systems, the error was that the c# sonar plugin version is not compatible with the SonarQube runner so decided to override all files contained in the Build agent for sonarqube prebuild C:***\Agent\tasks\SonarQubePreBuild\1.0.35\MSBuild.SonarQube.Runner-1.1 which make it work but i'm not sure if this is the right way how to it should work.

Additional Information:

TFS version: TFS 2015 update 4.1

SonarQube Version: 6.7.3

SonarQube C# plugin version: 7.0.1.4822

MSbuild Version: 15.0

MSBuild SonarQube Scanner: 4.2.0.1214-net46

Edit: Just to let you know, i didn't update the agent, I'm using the same one that was used before installing the Sonarqube.

1
If you are using the new TFS/VSTS (i.e. non-XAML) build system you shouldn't be updating the SonarQube.MSBuild.Runner directly. Instead, install the latest version of the SonarQube VSTS extension from the VSTS marketplace (marketplace.visualstudio.com/…).duncanp
I already did but with no luck, once installed it shows only SonarQube as option in services tab from collection configuration panel, am i missing something?Yazid
The services tab is about configuring external endpoints. You want to "manage extensions" - click on the shopping bag icon in the top right hand corner (see docs.microsoft.com/en-us/vsts/marketplace/…). The SonarQubePreBuild task is definitely not in the latest version - the newest tasks are now named SonarQubePrepare, SonarQubeAnalyze and SonarQubePublish. You'll need to install the new version of the extension, then edit your build definitions to use the new tasks.duncanp
Please provide more information to your question so that is is easier to help youRodrigo Werlang
@duncanp, i already installed the extension, but nothing has changed in the build steps, did i need to restart the tfs server ?Yazid

1 Answers

0
votes

This is a compatibility issue. Actually the error message already indicated that as you mentioned "c# sonar plugin version is not compatible with the SonarQube runner".

Just check the SonarQube Extension for VSTS/TFS Compatibility and Compatibility with the SonarQube C# plugin

Versions 3.x are compatible with:

  • TFS 2015 Update 3
  • TFS 2017 Update 1
  • VSTS

Versions 4.x are compatible with:

  • TFS 2017 Update 2+
  • TFS 2018
  • VSTS

Note: if you are running on TFS earlier than 2017 Update 2, you will need to download and manually install the latest 3.x version of the VSIX. You can download the VSIX on the "Releases" page of the GitHub repository You can browse the documentation on SonarQube Extension 3.0

enter image description here

So, in your scenario (TFS 2015 Update4.1) you need to follow instructions available on the "SonarQube Extension 3.0" documentation page.

Below article for your reference :

INTEGRATE SONARQUBE IN YOUR TFS OR VSTS BUILD


UPDATE:

It's still the compatibility issue, based on this Plugin Version Matrix SonarQube Version: 6.7.3 is not compatible with c# plugin 6.6, it's compatible with C# plugin 7.1.

In your scenario I suggest you downgrading to SonarQube server v6.x with c# plugin 6.6 as you have to install the "SonarQube Extension 3.0" to support TFS 2015.