我正在尝试将我在 Sonarqube 的主要分支从 更改为 ,master因为我在过去的几个月mainline里一直在进行分析。mainline
Sonar 社区下面的这篇文章说我必须删除mainline分支然后重命名master分支。这种方法的问题是我会失去我不想做的所有历史记录。
https://community.sonarsource.com/t/how-to-change-the-main-branch-in-sonarqube/13669/37
是否有办法将主分支更改为另一个分支而不丢失所有扫描历史记录?
使用:开发者版 - 版本 9.2.1
sonarqube sonarqube-web sonarqube-scan sonarqube-api sonarcloud
如何使用SonarQube的REST API获取项目的最后分析时间(您可以在仪表板中看到的那个)?
我正在使用SonarQube 4.5.6,但如果它仅在以后的版本中可用,我仍然对它是如何完成感兴趣.
我正在尝试使用SonarQube Web API从SonarQube获得json响应.分配JsonElement到JsonObject我收到此错误:
java.lang.IllegalStateException: Not a JSON Object
Run Code Online (Sandbox Code Playgroud)
@Controller
public class SonarController {
@Autowired
JenkinsDataService jenkinsService;
@Autowired
SonarDataService sonarService;
HttpEntity<String> entity;
@RequestMapping(value = { "/sonar" })
public void test(HttpServletRequest request, HttpServletResponse response,ModelMap model ) throws ServletException, IOException{
try{
String url= "http://sbstpvmlx818:9000/api/resources?metrics=coverage,sonar&depth=1&metrics=ncloc";
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
entity = new HttpEntity<String>("parameters", headers);
ResponseEntity<String> sonarResponse = restTemplate.exchange(url, HttpMethod.POST, entity, String.class);
JsonElement jelement = new JsonParser().parse(sonarResponse.getBody());
JsonObject jobject = jelement.getAsJsonObject();
} catch(Exception …Run Code Online (Sandbox Code Playgroud) 我正在将SonarQube从5.6版迁移到6.7版.我正在使用SonarQube API和我的Jenkins作业,问题是群组权限的API不适用于6.7版本...
我已尝试手动使用Postman(POST原始JSON):
{
"groupName": "project-name-admin",
"permission": "admin",
"projectKey": "project-name"
}
Run Code Online (Sandbox Code Playgroud)
返回的结果是:
{
"errors": [
{
"msg": "Group name or group id must be provided"
}
]
}
Run Code Online (Sandbox Code Playgroud)
如果我使用它也是一样的:
{
"groupId": 53,
"permission": "admin",
"projectKey": "project-name"
}
Run Code Online (Sandbox Code Playgroud)
要么
{
"groupId": 53,
"groupName": "project-name-admin",
"permission": "admin",
"projectKey": "project-name"
}
Run Code Online (Sandbox Code Playgroud)
它与6.5 verison一起工作,我不知道这个问题可能来自哪里:(
@SonarQube开发团队:你能修好thaaaat吗?
一旦质量门在SonarQube中失败,我就需要为项目触发HipChat通知.是否有REST API用于检查项目的质量门状态.我找不到它下api/quailty_gate或api/projects.
我也对其他触发hipChat通知的方法持开放态度.