如何使用SonarQube API将报告正确上传到SonarQube [英] How to upload a report to SonarQube properly using SonarQube API
问题描述
我想将使用lintr包在R中制作的json报告上传到我的SonarQube服务器.我正在利用api/ce/submit命令进行POST(您可以在 https://next.sonarqube.com/sonarqube/web_api/api/ce?internal=true ).为此,我使用具有以下参数的Postman:
I want to upload a json report made in R using lintr package to my SonarQube server. I'm making a POST taking advantage of the api/ce/submit command (You can find it in https://next.sonarqube.com/sonarqube/web_api/api/ce?internal=true). To do this i'm using Postman with this params:
- projectKey:XX
- projectName:XXname
- 报告:lintr_out.json
- projectBranch:testing-1.0
此命令在Sonar中创建项目,但无法显示报告信息.
This command create the Project in Sonar but it's not able to show the information of the report.
任何人都知道如何正确地在Sonar中查看报告的结果?谢谢大家!
Anybody knows how can i see the results of the report in Sonar properly? Thanks for all!
推荐答案
WS api/ce供内部使用(已标记).它不是API,它期望的报告可能随时更改其格式.
The WS api/ce is for internal use (as marked). It is not an API and the report it expect may change its format anytime.
要提交基于第三方linter的问题,建议您查看通用问题导入功能.您只需要将JSON文件转换为我们期望的格式即可.
To submit issues based on a third party linter, I advice you look at the generic issue import feature. You simply have to convert your JSON file to the format we expect.
这篇关于如何使用SonarQube API将报告正确上传到SonarQube的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!