- versions used SonarSource 1.26.1 via Azure Devops
I have noticed on AzureDevOps that the SonarCloudPrepare@1 task is adding an extra %27 into the API that is call by the task.
This is causing all of our build pipelines to fail at the same point.
When we click the link in the azure devops report we noticed that it has an extra %27 in the URL.
https://sonarcloud.io/api/settings/values?component=ourprojectkey' and we get the following error.
{
"errors": [
{
"msg": "Component key 'ourprojectkey'' not found"
}
]
}
If we remove the %27 from the URL it then returns the settings as expected.
{
"settings": [
{
"key": "sonar.project.monorepo.enabled",
"value": "false",
"inherited": true
},
{
"key": "sonaranalyzer-cs.nuget.packageVersion",
"value": "8.36.1.44192",
"inherited": true
},
{
"key": "sonaranalyzer.security.cs.pluginVersion",
"value": "9.4.0-M1.15235",
"inherited": true
},
{
"key": "sonar.cs.ignoreHeaderComments",
"value": "true",
"inherited": true
},
SonarScanner for MSBuild 5.5.3
Using the .NET Framework version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories...
10:40:47.823 Updating build integration targets...
10:40:48.318 Fetching analysis configuration settings...
10:40:48.415 10:40:48.415 WARNING: To analyze private projects make sure the scanner user has 'Browse' permission.
##[error]10:40:48.417 Failed to request and parse 'https://sonarcloud.io/api/settings/values?component=origo-services_Unipass': Response status code does not indicate success: 403 ().
10:40:48.417 Failed to request and parse 'https://sonarcloud.io/api/settings/values?component=ourprojectkey': Response status code does not indicate success: 403 ().
##[error]Unhandled Exception:
##[error]System.Net.Http.HttpRequestException: Response status code does not indicate success: 403 ().
We have made no changes and our task is pretty standard.
####################################################################
# SONARQUBE
####################################################################
- task: SonarCloudPrepare@1
condition: and(succeeded(), eq(variables.RunSonarQube, 'true'))
displayName: 'SonarQube Prepare'
inputs:
SonarCloud: 'SonarCloud'
organization: 'our-organisation'
scannerMode: 'MSBuild'
projectKey: 'our-organisation_ourproject'
projectName: 'Our Project'