You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
golden: "Error: analysis not found on https://sonarcloud.io. Snapshot may have been deleted by SonarQube\n",
162
+
golden: "Error: No activity found for task 'AZERk4uWpzGpahwkB9ac' on https://sonarcloud.io. \nSonarQube may be experiencing problems, please check https://status.sonarqube.com/ and try again later. \nOtherwise if you are attesting an older scan, the snapshot may have been deleted by SonarQube.\n",
163
163
},
164
164
{
165
165
wantError: true,
166
166
name: "if incorrect revision given (or the scan for the given revision has been deleted by SonarCloud)",
golden: "Error: analysis for revision b4d1053f2aac18c9fb4b9a289a8289199c932e12 of project cyber-dojo_differ not found. Check the revision is correct. Snapshot may also have been deleted by SonarQube\n",
168
+
golden: "Error: analysis for revision b4d1053f2aac18c9fb4b9a289a8289199c932e12 of project cyber-dojo_differ not found. Check the revision is correct. \nThe scan may still be being processed by SonarQube, try again later.\n Otherwise if you are attesting an older scan, the snapshot may also have been deleted by SonarQube\n",
169
169
},
170
170
{
171
171
wantError: true,
172
172
name: "if incorrect project key given, we get an error message from Sonar",
return"", fmt.Errorf("please check your API token is correct and you have the correct permissions in SonarQube")
239
239
}
240
-
// If the CETaskURL from the report-task.txt file gives a 404, the CE task does not exist.
241
-
iftaskResponseData.Task.Status=="" {
242
-
return"", fmt.Errorf("analysis not found on %s. Snapshot may have been deleted by SonarQube", sonarResults.ServerUrl)
240
+
// If the CETaskURL from the report-task.txt file gives a 404, the CE task does not exist, or SonarQube is down.
241
+
iftaskResponseData.Errors!=nil {
242
+
return"", fmt.Errorf("%s on %s. \nSonarQube may be experiencing problems, please check https://status.sonarqube.com/ and try again later. \nOtherwise if you are attesting an older scan, the snapshot may have been deleted by SonarQube.", taskResponseData.Errors[0].Msg, sonarResults.ServerUrl)
// This should only happen if the task is pending - either because the project is large and the scan takes a long time
282
282
// to process, or because SonarQube is experiencing delays for some reason.
283
283
ifanalysisId=="" {
284
-
return"", fmt.Errorf("analysis ID not found on %s. The scan results are not yet available, likely due to: \n1. Your project being particularly large and the scan taking time to process, or \n2. SonarQube is experiencing delays in processing scans. \nTry rerunning the command with the --max-wait flag.", sonarResults.ServerUrl)
284
+
return"", fmt.Errorf("analysis ID not found on %s. The scan results are not yet available, likely due to: \n1. Your project being particularly large and the scan taking time to process, or \n2. SonarQube experiencing delays in processing scans. \nTry rerunning the command with the --max-wait flag.", sonarResults.ServerUrl)
return"", fmt.Errorf("analysis for revision %s of project %s not found. Check the revision is correct. Snapshot may also have been deleted by SonarQube", revision, project.Key)
336
+
return"", fmt.Errorf("analysis for revision %s of project %s not found. Check the revision is correct. \nThe scan may still be being processed by SonarQube, try again later.\n Otherwise if you are attesting an older scan, the snapshot may also have been deleted by SonarQube", revision, project.Key)
returnnil, fmt.Errorf("sonar error: %s", qualityGateData.Errors[0].Msg) //We should never reach this point, since incorrect/outdated task/analysis IDs etc. should already have raised errors
399
+
returnnil, fmt.Errorf("SonarQube error: %s", qualityGateData.Errors[0].Msg) //We should never reach this point, since incorrect/outdated task/analysis IDs etc. should already have raised errors
0 commit comments