70 lines
1.8 KiB
JavaScript
70 lines
1.8 KiB
JavaScript
import fetch from './fetch';
|
|
|
|
// 获取列表
|
|
export function getList(params, owner, repo) {
|
|
return fetch({
|
|
url: `/api/v1/${owner}/${repo}/sonarqubes/issues_search.json?s=FILE_LINE`,
|
|
// url: `/api/issues/search?components=kingchanx-fluid-cloudnative_fluid&s=FILE_LINE&issueStatuses=CONFIRMED%2COPEN&&additionalFields=_all&timeZone=Asia%2FShanghai`,
|
|
method: 'get',
|
|
params
|
|
});
|
|
}
|
|
|
|
|
|
// 代码片段
|
|
export function getCodeSnippets(key, owner, repo) {
|
|
return fetch({
|
|
url: `/api/v1/${owner}/${repo}/sonarqubes/sources_issue_snippet.json?issueKey=${ key }`,
|
|
method: 'get',
|
|
});
|
|
}
|
|
|
|
// 问题分析
|
|
export function getProblemDetail(key, owner, repo) {
|
|
return fetch({
|
|
url: `/api/v1/${owner}/${repo}/sonarqubes/rules_show.json?key=${ key }`,
|
|
method: 'get',
|
|
});
|
|
}
|
|
|
|
// 数据汇总
|
|
export function getProblemData(owner, repo , keys) {
|
|
return fetch({
|
|
url: `/api/v1/${owner}/${repo}/sonarqubes/measures_component.json?component=${ owner }-${ repo }&metricKeys=${ keys }`,
|
|
method: 'get',
|
|
});
|
|
}
|
|
|
|
// 初始化sonar
|
|
export function initSonar(open, owner, repo) {
|
|
return fetch({
|
|
url: `/api/v1/${owner}/${repo}/sonarqubes/sonar_initialize.json?has_actions=${ open }`,
|
|
method: 'post',
|
|
});
|
|
}
|
|
|
|
// 开始分析
|
|
export function startAlalyze( branch , owner, repo) {
|
|
return fetch({
|
|
url: `/api/v1/${owner}/${repo}/sonarqubes/insert_file.json?branch=${ branch }`,
|
|
method: 'post',
|
|
});
|
|
}
|
|
|
|
// // 获取action任务列表
|
|
// export function getActionList(owner, repo ) {
|
|
// return fetch({
|
|
// url: `/api/v1/${owner}/${repo}/actions`,
|
|
// method: 'get',
|
|
// });
|
|
// }
|
|
|
|
// 获取action任务列表
|
|
export function getActionList(owner, repo ) {
|
|
return fetch({
|
|
url: `/api/v1/${owner}/${repo}/actions/runs?workflow=SonarScanner.yaml`,
|
|
method: 'get',
|
|
});
|
|
}
|
|
|