回复MR检视意见
功能介绍
回复MR检视意见
URI
POST /v2/repositories/{repository_id}/merge_requests/{merge_request_iid}/discussions/{discussion_id}/notes
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
repository_id |
是 |
Integer |
仓库短id 最小值:1 最大值:2147483647 |
|
merge_request_iid |
是 |
Integer |
合并请求iid 最小值:1 最大值:2147483647 |
|
discussion_id |
是 |
String |
评论id |
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
X-Auth-Token |
是 |
String |
用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
body |
是 |
String |
检视意见内容 |
响应参数
状态码: 200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
id |
Integer |
note id 最小值:1 最大值:2147483647 |
|
type |
String |
note类型 |
|
body |
String |
检视意见内容 |
|
attachment |
String |
附件 |
|
author |
UserBasicDto object |
作者 |
|
created_at |
String |
创建时间 |
|
updated_at |
String |
更新时间 |
|
system |
Boolean |
是否是系统生成的日志 |
|
noteable_id |
Integer |
目标id 最小值:1 最大值:2147483647 |
|
noteable_type |
String |
目标类型 |
|
commit_id |
String |
关联的提交id |
|
resolvable |
Boolean |
是否可解决 |
|
is_reply |
Boolean |
是否为回复的评论 |
|
resolved_by |
UserBasicDto object |
解决人 |
|
noteable_iid |
Integer |
目标iid 最小值:1 最大值:2147483647 |
|
discussion_id |
String |
讨论id |
|
project |
String |
所属项目 |
|
diff_file |
String |
变更文件 |
|
diff |
String |
变更内容 |
|
archived |
Boolean |
是否存档 |
|
review_categories |
String |
检视意见分类 |
|
review_categories_cn |
String |
检视意见分类中文名 |
|
review_categories_en |
String |
检视意见分类英文名 |
|
review_modules |
String |
检视意见模块 |
|
severity |
String |
严重程度 |
|
severity_cn |
String |
严重程度中文名 |
|
severity_en |
String |
严重程度英文名 |
|
file_path |
String |
文件路径 |
|
line |
String |
行号 |
|
assignee |
UserBasicDto object |
指派人 |
|
proposer |
UserBasicDto object |
提出人 |
|
position |
PositionDto object |
关联的代码位置 |
|
resolved |
Boolean |
是否解决 |
|
is_outdated |
Boolean |
是否过时 |
请求示例
POST https://{endpoint}/v2/repositories/{repository_id}/merge_requests/{merge_request_iid}/discussions/{discussion_id}/notes
{
"body" : "回复内容"
}
响应示例
状态码: 200
OK
{
"result" : {
"id" : 2111886200,
"type" : "DiffNote",
"body" : "检视意见内容",
"author" : {
"id" : 1234,
"name" : "beta",
"username" : "c369c68f1ff84679b5a8ed904d8bff1c",
"state" : "active",
"name_cn" : "beta"
},
"created_at" : "2023-06-01T17:05:12.000+08:00",
"updated_at" : "2023-06-01T17:05:12.000+08:00",
"system" : false,
"noteable_id" : 19387,
"noteable_type" : "MergeRequest",
"resolvable" : true,
"is_reply" : true,
"noteable_iid" : 2,
"discussion_id" : "8bbe6d4e797169c4c1ce56507fdf1abc11f95601",
"project" : "DevOpsqlcylxm00004/project-test",
"diff_file" : "7",
"diff" : "@@ -0,0 +1,0 @@\n+7",
"archived" : false,
"review_categories" : "regulations",
"review_categories_cn" : "编程军规问题",
"review_categories_en" : "Regulations",
"review_modules" : "aaa,bbb",
"severity" : "suggestion",
"severity_cn" : "建议",
"severity_en" : "Suggestion",
"assignee" : {
"id" : 1234,
"name" : "beta",
"username" : "c369c68f1ff84679b5a8ed904d8bff1c",
"state" : "active",
"name_cn" : "beta"
},
"proposer" : {
"id" : 1234,
"name" : "beta",
"username" : "c369c68f1ff84679b5a8ed904d8bff1c",
"state" : "active",
"name_cn" : "beta"
},
"position" : {
"base_sha" : "973bcc0211c32dbaa8473561c6767f74e1a81471",
"start_sha" : "973bcc0211c32dbaa8473561c6767f74e1a81471",
"head_sha" : "f5bf0230f9b996ed6c0d64d2b2fef789d91b164c",
"old_path" : "7",
"new_path" : "7",
"position_type" : "text",
"new_line" : 1
},
"resolved" : false,
"is_outdated" : false
},
"status" : "success"
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
OK |
错误码
请参见错误码。