Template for a good new topic, formatted with Markdown:
- ALM used: GitHub
- AWS CodePipeline (CodeBuild)
- Scanner command: sonar-scanner -Dsonar.organization=$Organization -Dsonar.projectKey=$Project -Dsonar.sources=. -Dsonar.host.url=$HOST -Dsonar.branch.name=$Branch
- Languages of the repository: Python
- Error observed: During the “Test” stage I built on my CodePipeline AWS Service, I’m getting “Project doesn’t exist” while trying to curl the analysis report
[Container] 2023/01/13 21:32:12 Running command curl ***/api/qualitygates/project_status?projectKey=*** >result.json
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 49 100 49 0 0 117 0 --:--:-- --:--:-- --:--:-- 117
[Container] 2023/01/13 21:32:12 Running command cat result.json
978 {"errors":[{"msg":"Project doesn\u0027t exist"}]}
979 [Container] 2023/01/13 21:32:12 Running command echo $CODEBUILD_BUILD_SUCCEEDING
980 1
981
982 [Container] 2023/01/13 21:32:12 Running command if [ $(jq -r '.projectStatus.status' result.json) = ERROR ] ; then $CODEBUILD_BUILD_SUCCEEDING -eq 0 ;fi
- Steps to reproduce:
While I try to retrieve the report in json format that is given from SonarCloud in order to make my stage pass or fail, I’m able to connect to the server but not able to retrieve the proper information.
This is the URL where I’m trying to retrieve my results:
https://sonarcloud.io/api/qualitygates/project_status?projectKey=trip_ninja_api
- Potential workaround
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!