Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GitLab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
projects.thm.de
GitLab
Commits
81f2a9e5
Commit
81f2a9e5
authored
Dec 15, 2015
by
Kirill Skachkov
Committed by
Rémy Coutable
Feb 08, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API: Allow to set or update a merge-request's milestone
parent
9fdd605f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+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
No files found.
CHANGELOG
View file @
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
View file @
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
View file @
81f2a9e5
...
...
@@ -71,6 +71,7 @@ def handle_merge_request_errors!(errors)
# 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 @@ def handle_merge_request_errors!(errors)
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 @@ def handle_merge_request_errors!(errors)
# 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment