feat(ai-code-review): 建問題模式導向 issue,並整併流程調整、文件與 CI #6
@@ -168,27 +168,6 @@ function createIssue(ctx, { title, body, labels }) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 為既有 issue 追加標籤(不影響既有標籤)。
|
|
||||||
* 對應 endpoint:`POST /repos/{owner}/{repo}/issues/{issueNumber}/labels`。
|
|
||||||
* `labels` 為空陣列時不呼叫 API、直接回傳 `null`(省一次無意義請求)。
|
|
||||||
*
|
|
||||||
* @param {object} ctx - 執行環境 context。必要欄位:`apiBase`、`token`、
|
|
||||||
* `owner`(repo 擁有者)、`repo`(repo 名稱)。
|
|
||||||
* @param {number|string} issueNumber - 目標 issue 編號。
|
|
||||||
* @param {number[]} labels - 要追加的標籤 id 陣列。
|
|
||||||
* @returns {Promise<object[]|null>} 追加後該 issue 的標籤陣列(依 Gitea API 回應而定);
|
|
||||||
* `labels` 為空時回傳 `null`(未發出請求)。
|
|
||||||
* @throws {Error} 請求失敗(非 2xx)由底層 `api` 丟出,錯誤附 `status`、`data`。
|
|
||||||
* @remarks 使用情境:為既有 issue 動態追加標籤的通用工具(不影響既有標籤)。
|
|
||||||
* 註:建問題模式主流程已改為「建立 issue 時一次帶入標籤」(見 `createIssue`),
|
|
||||||
* 不再於事後補掛;本函式保留為 Gitea 客戶端的通用能力,供需要事後追加標籤的情境使用。
|
|
||||||
*/
|
|
||||||
function addLabelsToIssue(ctx, issueNumber, labels) {
|
|
||||||
if (!labels || labels.length === 0) return Promise.resolve(null);
|
|
||||||
return api(ctx, 'POST', `/repos/${ctx.owner}/${ctx.repo}/issues/${issueNumber}/labels`, { labels });
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 建立「問題相依」關係:讓 URL 上的 issue/PR 相依於(被阻擋於)表單指定的 issue。
|
* 建立「問題相依」關係:讓 URL 上的 issue/PR 相依於(被阻擋於)表單指定的 issue。
|
||||||
* 對應 endpoint:`POST /repos/{owner}/{repo}/issues/{issueNumber}/dependencies`
|
* 對應 endpoint:`POST /repos/{owner}/{repo}/issues/{issueNumber}/dependencies`
|
||||||
@@ -350,7 +329,6 @@ module.exports = {
|
|||||||
createCommentOnIssue,
|
createCommentOnIssue,
|
||||||
listLabels,
|
listLabels,
|
||||||
createIssue,
|
createIssue,
|
||||||
addLabelsToIssue,
|
|
||||||
addIssueDependency,
|
addIssueDependency,
|
||||||
listIssueComments,
|
listIssueComments,
|
||||||
editIssueComment,
|
editIssueComment,
|
||||||
|
|||||||
Reference in New Issue
Block a user