How to upload a report to SonarQube properly using SonarQube API

老子叫甜甜 提交于 2020-04-16 02:52:09

问题


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:

  1. projectKey: XX
  2. projectName: XXname
  3. report: lintr_out.json
  4. projectBranch: testing-1.0

This command create the Project in Sonar but it's not able to show the information of the report.

Anybody knows how can i see the results of the report in Sonar properly? Thanks for all!


回答1:


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.

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.



来源:https://stackoverflow.com/questions/55416027/how-to-upload-a-report-to-sonarqube-properly-using-sonarqube-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!