Hello.
Thank you for taking a look at my topic.
This text is a machine translation.
I have an error when calling the API of SonarQube 8.9.7 from a Gitlab pipeline. Please let me borrow your wisdom.
■ Situation
・The version of SonarQube is 8.9.7, previously built with v7.9.3, but upgraded to add new_code_periods API.
・The API user can log in to the web screen.
・The Execute Analysis privilege has been granted to the user executing the API.
◆POST api/projects/create
The project is successfully executed and can be viewed on the screen.
◆GET api/new_code_periods/list
We are adding and verifying this for the first time in the v8.9.7 environment.
I have run it 4 times in the same project and always get an error.
>Request.
NEW_CODE_PERIODS=`curl --globoff -u ${SONAR_USER}:${SONAR_PASSWORD} -X GET ${SONAR_URL}api/new_code_periods/list?project="${project_key}"`
echo ${NEW_CODE_PERIODS}
>execution result
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 46 100 46 0 0 125 0 --:--:-- --:--:-- --:--:-- 125
{"errors":[{"msg": "Insufficient privileges"}]}
◆POST api/qualityprofiles/add_project
It is executed a total of 9 times with different languages.
This API was working fine in the v7.9.3 environment, but now randomly produces errors in the v8.9.7 environment.
We have tested it a total of 4 times, including the times we created the project, and each time the error occurs in 4~6 different requests.
>Request.
curl --globoff -u ${SONAR_USER}:${SONAR_PASSWORD} -X POST ${SONAR_URL}api/qualityprofiles/add_project?language="css"\&qualityProfile="${SONAR__QUALITY_PROFILE_CSS}"\&project="${project_key}"
>execution result
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 46 100 46 0 0 0 144 0 --:--:-- --:--:-- --:--:-- 144
{"errors":[{"msg": "Insufficient privileges"}]}
Thank you very much for your cooperation.
makiyama
Translated with DeepL Translate: The world's most accurate translator (free version)