According to the SQ TFS task extension 4.0 compatibility documentation (sorry, tried to link this, but I’m a new user limited to two links, and the other links seemed more important), the TFS extension is compatible with “TFS 2017 Update 2+”. Unfortunately, it seems that in the task.json files for both 4.0.1 TFS task extensions, the minimumAgentVersion is incorrect. In the case of the SonarQubeAnalyze task, the incorrect version causes unexpected build failures.
- SQ scanner 4.0.1
- TFS 2017u2 (also known as 2017.2)
- TFS agent 2.117.2 (agent version corresponding to TFS 2017u2)
- Unrelated to SQ server version
- On TFS 2017u2 with corresponding TFS agent 2.117.2, the SQ SonarQubePrepare 4.0.1 task succeeds, but the SQ SonarQubeAnalyze 4.0.1 task fails with an error message about minimum agent version
- TFS 2017u2 server
- TFS agent 2.117.2 (corresponds to TFS 2017u2)
- SQ VSTS task extension 4.0.1 installed
- Working build which uses prior SQ VSTS tasks 3.x (either manually downgraded, or version selected before 4.0.1 extension was installed)
- Edit the working build to upgrade the SQ VSTS tasks from 3.x to 4.0.1
- Save and Queue the edited build
- SQ Analyze task fails with error message about minimum agent version
- Use 3.x SQ tasks until 4.0.1 SQ task.json files are corrected
- Upgrade TFS to 2017u3.1 or later, subsequently upgrading agents via TFS web portal
- (untested but likely to work) Remain on TFS 2017u2, but manually upgrade TFS agents to version >= 2.119.1; agent 2.122.1 (corresponds to TFS 2017u3, 2017u3.1, and 2018 RTW) should work with TFS 2017u2
- Alter line 17 of the SonarQubeAnalyze 4.0.1 task.json file to set the version to “2.117.2”. This will prevent unwarranted build failures.
- Alter line 18 of the SonarQubePrepare 4.0.1 task.json file (new user limited to two links, and the one below matters more) to set the version to “2.117.2”. Since both tasks are used together for MSBuild analysis, there is no good reason for them to have different minimum requirements for TFS agent version. However, this inconsistency does not produce build failures, and leaving it as the TFS 2015u3 agent version should cause no harm.
For reference, the designation for the TFS agent 2.117.2 release includes “TFS 2017 QU2” and the release description there states “This will be the TFS2017 Update2 Agent”. Based on experience with our TFS 2017u2 instances, I can confirm that information.
Thanks and Regards,