Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
29448964
Commit
29448964
authored
Jan 23, 2018
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return more consistent values for merge_status on MR API
parent
60f37285
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
changelogs/unreleased/osw-updates-merge-status-on-api-actions.yml
...gs/unreleased/osw-updates-merge-status-on-api-actions.yml
+5
-0
lib/api/entities.rb
lib/api/entities.rb
+8
-1
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+2
-0
No files found.
changelogs/unreleased/osw-updates-merge-status-on-api-actions.yml
0 → 100644
View file @
29448964
---
title
:
Return more consistent values for merge_status on MR APIs
merge_request
:
author
:
type
:
fixed
lib/api/entities.rb
View file @
29448964
...
...
@@ -507,7 +507,14 @@ module API
expose
:work_in_progress?
,
as: :work_in_progress
expose
:milestone
,
using:
Entities
::
Milestone
expose
:merge_when_pipeline_succeeds
expose
:merge_status
# Ideally we should deprecate `MergeRequest#merge_status` exposure and
# use `MergeRequest#mergeable?` instead (boolean).
# See https://gitlab.com/gitlab-org/gitlab-ce/issues/42344 for more
# information.
expose
:merge_status
do
|
merge_request
|
merge_request
.
tap
(
&
:check_if_can_be_merged
).
merge_status
end
expose
:diff_head_sha
,
as: :sha
expose
:merge_commit_sha
expose
:user_notes_count
...
...
spec/requests/api/merge_requests_spec.rb
View file @
29448964
...
...
@@ -198,6 +198,8 @@ describe API::MergeRequests do
create
(
:merge_request
,
state:
'closed'
,
milestone:
milestone1
,
author:
user
,
assignee:
user
,
source_project:
project
,
target_project:
project
,
title:
"Test"
,
created_at:
base_time
)
create
(
:merge_request
,
milestone:
milestone1
,
author:
user
,
assignee:
user
,
source_project:
project
,
target_project:
project
,
title:
"Test"
,
created_at:
base_time
)
expect
do
get
api
(
"/projects/
#{
project
.
id
}
/merge_requests"
,
user
)
end
.
not_to
exceed_query_limit
(
control
)
...
...
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