可视化评审讨论 API
专业版

  • 引入于极狐GitLab 12.5。
  • 移动到极狐GitLab 专业版于 13.9。

WARNING: 此功能废弃于极狐GitLab 15.8,并计划于 17.0 移除。此为突破性变更。

创建新的合并请求主题#

为单个项目合并请求创建一个新的主题。类似于创建注释,但稍后可以添加其他评论(回复)。

plaintext
POST /projects/:id/merge_requests/:merge_request_iid/visual_review_discussions

参数:

参数类型是否必需描述
idinteger/stringyesID 或 URL 编码的项目路径
merge_request_iidintegeryes合并请求 IID
bodystringyes主题的内容
positionhashno创建差异注释时的位置
position[base_sha]stringyes源分支中的基础提交 SHA
position[start_sha]stringyes在目标分支中引用提交的 SHA
position[head_sha]stringyes引用此合并请求的 HEAD 的 SHA
position[position_type]stringyes位置引用的类型:textimage
position[new_path]stringno更改后的文件路径
position[new_line]integerno更改后的行数(仅为 text 差异注释存储)
position[old_path]stringno更改前的文件路径
position[old_line]integerno更改前的行数(仅为 text 差异注释存储)
position[width]integerno图片宽度(仅为 image 差异注释存储)
position[height]integerno图片高度(仅为 image 差异注释存储)
position[x]integernoX 坐标(仅为 image 差异注释存储)
position[y]integernoY 坐标(仅为 image 差异注释存储)
shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/visual_review_discussions?body=comment"