通過 OpenAPI 查詢單個合并請求(舊)。
服務存取點與授權資訊
產品 | 資源 | 要求的權限 |
代碼管理 | 合并請求 | 唯讀 |
請求文法
要求標頭
參數 | 類型 | 是否必填 | 描述 | 樣本值 |
x-yunxiao-token | string | 是 | 個人存取權杖。 | pt-0fh3****0fbG_35af****0484 |
請求參數
參數 | 類型 | 位置 | 是否必填 | 描述 | 樣本值 |
repositoryId | integer | path | 是 | 程式碼程式庫 ID 或者 URL-Encoder 編碼的全路徑。 | 2813489或者60de7a6852743a5162b5f957%2FDemoRepo |
iid | integer | path | 是 | 庫內合并請求 ID。 | 1 |
請求樣本
curl -X 'GET' \
'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/repositories/2813489或者60de7a6852743a5162b5f957%2FDemoRepo/mergeRequests/1' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'
返回參數
參數 | 類型 | 描述 | 樣本值 |
| - | object | ||
| acceptedRevision | string | 評審通過時的版本。 | 6da8c14b5a9102998148b7ea35f96507d5304f74 |
| ahead | integer | 源分支領先目標分支的 commit 數量。 | 1 |
| assignees | array | 評審人列表。 | |
| - | object | ||
| avatar | string | 頭像地址。 | https://example/example/w/100/h/100 |
string | 郵箱。 | username@example.com | |
| id | integer | 資料庫主鍵 ID(無業務意義)。 | 1 |
| name | string | 使用者名稱稱。 | codeup-name |
| state | string | 使用者狀態,包括{active、blocked},一般為 active。 | active |
| status | string | 評審人的評審狀態,包括:approved - 評審通過,pending - 待處理,comment - 發表過評論、點贊等。 | approved |
| userId | string | 雲效使用者識別碼(在 codeup 的 OpenAPI 中涉及到使用者識別碼 之處,均應使用該使用者識別碼)。 | 62c795xxxb468af8 |
| username | string | 使用者名稱稱(登入名稱)。 | codeup-username |
| author | object | 使用者資訊。 | |
| avatar | string | 頭像地址。 | https://example/example/w/100/h/100 |
string | 郵箱。 | username@example.com | |
| id | integer | 資料庫主鍵 ID(無業務意義)。 | 1 |
| name | string | 使用者名稱稱。 | codeup-name |
| state | string | 使用者狀態,包括{active、blocked},一般為 active。 | active |
| userId | string | 雲效使用者識別碼(在 codeup 的 OpenAPI 中涉及到使用者識別碼 之處,均應使用該使用者識別碼)。 | 62c795xxxb468af8 |
| username | string | 使用者名稱稱(登入名稱)。 | codeup-username |
| behind | integer | 目標分支領先源分支的 commit 數量。 | 1 |
| createdAt | string | 建立時間。 | 2024-10-05T15:30:45Z |
| creationMethod | string | 建立方式,包括:WEB、COMMAND,預設建立方式為 WEB。 | WEB |
| description | string | 合并請求描述資訊。 | mr description |
| detailUrl | string | 合并請求詳情地址。 | https://example.com/example/example_demo/merge_requests/1 |
| downvotes | integer | 不通過投票數。 | 1 |
| id | integer | 合并請求 ID。 | 1 |
| iid | integer | 庫內合并請求 ID,表示屬於程式碼程式庫內的第幾個合并請求 ID。 | 1 |
| isUsePushBlock | boolean | 是否開啟推送攔截。 | false |
| labels | array[string] | 標籤(label)列表。 | ["BUG"] |
| mergeStatus | string | 合并請求合并狀態,包括:unchecked-未檢查,can_be_merged-待合并,cannot_be_merged-不可合并。 | can_be_merged |
| mergedRevision | string | 合并的版本。 | 6da8c14b5a9102998148b7ea35f96507d5304f74 |
| nameWithNamespace | string | 程式碼程式庫的全名稱(包含父路徑)。 | 60de7a6852743a5162b5f957 / DemoRepo(斜杠兩側有空格) |
| projectId | integer | 程式碼程式庫 ID。 | 2813489 |
| sourceBranch | string | 源分支。 | demo-branch |
| sourceProjectId | integer | 評審分支所在的程式碼程式庫 ID。 | 2813489 |
| sourceProjectName | string | 源庫名稱。 | Codeup-Demo |
| sourceType | string | 合并源類型,包括:BRANCH、COMMIT。 | BRANCH |
| sshUrlToRepo | string | 倉庫 SSH 複製地址。 | git@example:example_org/example.git |
| state | string | 合并請求狀態:opened-已開啟,closed-已關閉,merged-已合并,accepted-評審通過,reopened-重新開啟,locked-合并中。 | opened |
| subscribers | array | 訂閱人列表。 | |
| - | object | 使用者資訊。 | |
| avatar | string | 頭像地址。 | https://example/example/w/100/h/100 |
string | 郵箱。 | username@example.com | |
| id | integer | 資料庫主鍵 ID(無業務意義)。 | 1 |
| name | string | 使用者名稱稱。 | codeup-name |
| state | string | 使用者狀態,包括{active、blocked},一般為 active。 | active |
| userId | string | 雲效使用者識別碼(在 codeup 的 OpenAPI 中涉及到使用者識別碼 之處,均應使用該使用者識別碼)。 | 62c795xxxb468af8 |
| username | string | 使用者名稱稱(登入名稱)。 | codeup-username |
| supportMergeFFOnly | boolean | 是否支援 ff-only 合并方式。 | true |
| targetBranch | string | 目標分支。 | master |
| targetProjectId | integer | 目標分支所在的程式碼程式庫 ID。 | 2813489 |
| targetProjectName | string | 目標庫名稱。 | Codeup-Demo |
| targetType | string | 合并目標類型,包括:BRANCH、COMMIT。 | BRANCH |
| title | string | 合并請求標題。 | mr title |
| updatedAt | string | 更新時間。 | 2024-10-05T15:30:45Z |
| upvotes | integer | 通過投票數。 | 1 |
| webUrl | string | 網址。 | https://example.com/example/example_demo/merge_requests/1 |
| workInProgress | boolean | WIP 標識,即合并請求還處於開發中。 | false |
返回樣本
{
"acceptedRevision": "6da8c14b5a9102998148b7ea35f96507d5304f74",
"ahead": 1,
"assignees": [
{
"avatar": "https://example/example/w/100/h/100",
"email": "username@example.com",
"id": 1,
"name": "codeup-name",
"state": "active",
"status": "approved",
"userId": "62c795xxxb468af8",
"username": "codeup-username"
}
],
"author": {
"avatar": "https://example/example/w/100/h/100",
"email": "username@example.com",
"id": 1,
"name": "codeup-name",
"state": "active",
"userId": "62c795xxxb468af8",
"username": "codeup-username"
},
"behind": 1,
"createdAt": "2024-10-05T15:30:45Z",
"creationMethod": "WEB",
"description": "mr description",
"detailUrl": "https://example.com/example/example_demo/merge_requests/1",
"downvotes": 1,
"id": 1,
"iid": 1,
"isUsePushBlock": false,
"labels": ["BUG"],
"mergeStatus": "can_be_merged",
"mergedRevision": "6da8c14b5a9102998148b7ea35f96507d5304f74",
"nameWithNamespace": "60de7a6852743a5162b5f957 / DemoRepo(斜杠兩側有空格)",
"projectId": 2813489,
"sourceBranch": "demo-branch",
"sourceProjectId": 2813489,
"sourceProjectName": "Codeup-Demo",
"sourceType": "BRANCH",
"sshUrlToRepo": "git@example:example_org/example.git",
"state": "opened",
"subscribers": [
{
"avatar": "https://example/example/w/100/h/100",
"email": "username@example.com",
"id": 1,
"name": "codeup-name",
"state": "active",
"userId": "62c795xxxb468af8",
"username": "codeup-username"
}
],
"supportMergeFFOnly": true,
"targetBranch": "master",
"targetProjectId": 2813489,
"targetProjectName": "Codeup-Demo",
"targetType": "BRANCH",
"title": "mr title",
"updatedAt": "2024-10-05T15:30:45Z",
"upvotes": 1,
"webUrl": "https://example.com/example/example_demo/merge_requests/1",
"workInProgress": false
}
錯誤碼
訪問錯誤碼中心查看 API 相關錯誤碼。