查询单个合并请求详情。
接口说明
该接口需要确保当前企业已经在使用新版 MR,具体可看当前企业的合并请求页面是否已是新版本。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求语法
GET /api/v4/projects/{repositoryId}/merge_requests/{localId}/detail HTTP/1.1
路径参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| repositoryId |
integer |
是 |
代码库 ID |
2464454 |
| localId |
integer |
是 |
合并请求局部 ID,表示代码库下的第几个合并请求 |
1 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| organizationId |
string |
是 |
企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】 |
5ebbc0228123212b59xxxxx |
| accessToken |
string |
否 |
个人访问令牌。 使用阿里云 AK+SK 或使用 STS 临时授权方式不需要传该字段 |
f0b1e61db5961df5975a93f9129d2513 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| requestId |
string |
请求 ID |
F7B85D1B-D1C2-140F-A039-341859F130B9 |
| errorMessage |
string |
错误信息 |
"" |
| errorCode |
string |
错误码 |
Openapi.RequestError |
| success |
boolean |
调用是否成功 |
true |
| result |
object |
返回结果 |
|
| mrBizId |
string |
合并请求唯一 ID |
bca90244c4b749e0b109df52ac0eb570 |
| projectId |
integer |
代码库 ID |
2369234 |
| localId |
integer |
合并请求局部 ID,表示代码库下的第几个合并请求 |
1 |
| createTime |
string |
创建时间,采用 ISO 8601 格式的 UTC 时间。 |
2023-05-30T02:53:36Z |
| updateTime |
string |
更新时间,采用 ISO 8601 格式的 UTC 时间。 |
2023-05-30T02:53:36Z |
| mrType |
string |
合并请求类型,通常为 CODE_REVIEW
|
CODE_REVIEW |
| sourceProjectId |
integer |
源代码库 ID |
2369234 |
| sourceBranch |
string |
源分支 |
test-merge-request |
| targetProjectId |
integer |
目标库 ID |
2369234 |
| targetBranch |
string |
目标分支 |
master |
| title |
string |
合并请求标题 |
test-合并请求标题 |
| description |
string |
合并请求描述信息 |
test-合并请求的具体描述内容 |
| reviewers |
array<object> |
评审人信息列表 |
|
|
object |
评审人信息 |
||
| id |
integer |
Codeup 的用户 ID |
90452 |
| name |
string |
用户名称 |
test-codeup |
| username |
string |
用户登录名 |
root-test-codeup |
| state |
string |
用户状态,可选值:
|
active |
| avatarUrl |
string |
头像地址 |
https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100 |
|
string |
用户邮箱 |
username@example.com |
|
| hasReviewed |
boolean |
评审人是否已经评审过 |
false |
| reviewOpinionStatus |
string |
评审意见,若未评审则为空
|
NOT_PASS |
| reviewTime |
string |
评审人评审完成时间 说明
需要确保评审人已经完成评审,否则该值为空,采用 ISO 8601 格式的 UTC 时间。 |
2023-05-30T02:53:36Z |
| hasCommented |
boolean |
评审人是否发表过评论 |
true |
| author |
object |
作者信息 |
|
| id |
integer |
Codeup 用户 ID |
19927 |
| name |
string |
用户名称 |
test-codeup |
| username |
string |
用户登录名 |
root-test-codeup |
| state |
string |
用户状态,可选值:
|
active |
| avatarUrl |
string |
头像地址 |
https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100 |
|
string |
用户邮箱 |
username@example.com |
|
| subscribers |
array<object> |
订阅人信息列表 |
|
|
object |
订阅人信息 |
||
| id |
integer |
Codeup 的用户 ID |
90452 |
| name |
string |
用户名称 |
test-subscriber |
| username |
string |
用户登录名 |
test-subscriber |
| state |
string |
用户状态,可选值:
|
active |
| avatarUrl |
string |
头像地址 |
https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100 |
|
string |
用户邮箱 |
username@example.com |
|
| status |
string |
合并请求状态
|
UNDER_REVIEW |
| createFrom |
string |
创建来源
|
WEB |
| ahead |
integer |
源分支相较于目标分支多出的 commit 数量 |
1 |
| behind |
integer |
目标分支相较于源分支落后的 commit 数量 |
1 |
| todoList |
object |
待办事项 |
|
| requirementCheckItems |
array<object> |
卡点项列表 |
|
|
object |
卡点项信息 |
||
| itemType |
string |
卡点项类型
|
COMMENTS_CHECK |
| pass |
boolean |
是否通过卡点项 |
true |
| allRequirementsPass |
boolean |
是否所有卡点通过 |
true |
| supportMergeFastForwardOnly |
boolean |
是否支持 fast-forward-only 的合并方式 |
true |
| detailUrl |
string |
合并请求详情地址 |
xxx |
| webUrl |
string |
页面访问时的 URL |
xxx |
| targetProjectNameWithNamespace |
string |
目标库的全名称(含完整组路径) |
orgId / test-group / test-target-repo(斜杠两侧有空格) |
| targetProjectPathWithNamespace |
string |
目标库的全路径(含完整组路径) |
orgId/test-group/test-target-repo |
| mergedRevision |
string |
合并版本(Commit SHA) |
1a072f5367c21f9de3464b8c0ee8546e47764d2d |
示例
正常返回示例
JSON格式
{
"requestId": "F7B85D1B-D1C2-140F-A039-341859F130B9",
"errorMessage": "\"\"",
"errorCode": "Openapi.RequestError",
"success": true,
"result": {
"mrBizId": "bca90244c4b749e0b109df52ac0eb570",
"projectId": 2369234,
"localId": 1,
"createTime": "2023-05-30T02:53:36Z",
"updateTime": "2023-05-30T02:53:36Z",
"mrType": "CODE_REVIEW",
"sourceProjectId": 2369234,
"sourceBranch": "test-merge-request",
"targetProjectId": 2369234,
"targetBranch": "master",
"title": "test-合并请求标题",
"description": "test-合并请求的具体描述内容",
"reviewers": [
{
"id": 90452,
"name": "test-codeup",
"username": "root-test-codeup",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"email": "username@example.com",
"hasReviewed": false,
"reviewOpinionStatus": "NOT_PASS",
"reviewTime": "2023-05-30T02:53:36Z",
"hasCommented": true
}
],
"author": {
"id": 19927,
"name": "test-codeup",
"username": "root-test-codeup",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"email": "username@example.com"
},
"subscribers": [
{
"id": 90452,
"name": "test-subscriber",
"username": "test-subscriber",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"email": "username@example.com"
}
],
"status": "UNDER_REVIEW",
"createFrom": "WEB",
"ahead": 1,
"behind": 1,
"todoList": {
"requirementCheckItems": [
{
"itemType": "COMMENTS_CHECK",
"pass": true
}
]
},
"allRequirementsPass": true,
"supportMergeFastForwardOnly": true,
"detailUrl": "xxx",
"webUrl": "xxx",
"targetProjectNameWithNamespace": "orgId / test-group / test-target-repo(斜杠两侧有空格)",
"targetProjectPathWithNamespace": "orgId/test-group/test-target-repo",
"mergedRevision": "1a072f5367c21f9de3464b8c0ee8546e47764d2d"
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。