Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
81f2a9e5
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
81f2a9e5
编写于
12月 15, 2015
作者:
K
Kirill Skachkov
提交者:
Rémy Coutable
2月 08, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
API: Allow to set or update a merge-request's milestone
上级
9fdd605f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
7 addition
and
2 deletion
+7
-2
CHANGELOG
CHANGELOG
+1
-0
doc/api/merge_requests.md
doc/api/merge_requests.md
+2
-0
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+4
-2
未找到文件。
CHANGELOG
浏览文件 @
81f2a9e5
...
...
@@ -31,6 +31,7 @@ v 8.5.0 (unreleased)
- Prevent parse error when name of project ends with .atom and prevent path issues
- Mark inline difference between old and new paths when a file is renamed
- Support Akismet spam checking for creation of issues via API (Stan Hu)
- API: Allow to set or update a merge-request's milestone (Kirill Skachkov)
- Improve UI consistency between projects and groups lists
- Add sort dropdown to dashboard projects page
- Fixed logo animation on Safari (Roman Rott)
...
...
doc/api/merge_requests.md
浏览文件 @
81f2a9e5
...
...
@@ -225,6 +225,7 @@ Parameters:
-
`description`
(optional) - Description of MR
-
`target_project_id`
(optional) - The target project (numeric id)
-
`labels`
(optional) - Labels for MR as a comma-separated list
-
`milestone_id`
(optional) - Milestone ID
```
json
{
...
...
@@ -277,6 +278,7 @@ Parameters:
-
`description`
- Description of MR
-
`state_event`
- New state (close|reopen|merge)
-
`labels`
(optional) - Labels for MR as a comma-separated list
-
`milestone_id`
(optional) - Milestone ID
```
json
{
...
...
lib/api/merge_requests.rb
浏览文件 @
81f2a9e5
...
...
@@ -71,6 +71,7 @@ module API
# title (required) - Title of MR
# description - Description of MR
# labels (optional) - Labels for MR as a comma-separated list
# milestone_id (optional) - Milestone ID
#
# Example:
# POST /projects/:id/merge_requests
...
...
@@ -78,7 +79,7 @@ module API
post
":id/merge_requests"
do
authorize!
:create_merge_request
,
user_project
required_attributes!
[
:source_branch
,
:target_branch
,
:title
]
attrs
=
attributes_for_keys
[
:source_branch
,
:target_branch
,
:assignee_id
,
:title
,
:target_project_id
,
:description
]
attrs
=
attributes_for_keys
[
:source_branch
,
:target_branch
,
:assignee_id
,
:title
,
:target_project_id
,
:description
,
:milestone_id
]
# Validate label names in advance
if
(
errors
=
validate_label_params
(
params
)).
any?
...
...
@@ -163,11 +164,12 @@ module API
# state_event - Status of MR. (close|reopen|merge)
# description - Description of MR
# labels (optional) - Labels for a MR as a comma-separated list
# milestone_id (optional) - Milestone ID
# Example:
# PUT /projects/:id/merge_requests/:merge_request_id
#
put
path
do
attrs
=
attributes_for_keys
[
:target_branch
,
:assignee_id
,
:title
,
:state_event
,
:description
]
attrs
=
attributes_for_keys
[
:target_branch
,
:assignee_id
,
:title
,
:state_event
,
:description
,
:milestone_id
]
merge_request
=
user_project
.
merge_requests
.
find
(
params
[
:merge_request_id
])
authorize!
:update_merge_request
,
merge_request
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录