Commit b021f889 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch '30161-expose-merge-request-status-in-api' into 'master'

Return merge-request state in API

See merge request gitlab-org/gitlab!18888
parents 97944f44 611fe8c1
---
title: Expose mergeable state of a merge request
merge_request: 18888
author: briankabiro
type: added
......@@ -304,7 +304,9 @@ Parameters:
"task_completion_status":{
"count":0,
"completed_count":0
}
},
"has_conflicts": false,
"blocking_discussions_resolved": true
}
]
```
......@@ -453,7 +455,9 @@ Parameters:
"task_completion_status":{
"count":0,
"completed_count":0
}
},
"has_conflicts": false,
"blocking_discussions_resolved": true
}
]
```
......@@ -606,7 +610,9 @@ Parameters:
"task_completion_status":{
"count":0,
"completed_count":0
}
},
"has_conflicts": false,
"blocking_discussions_resolved": true
}
```
......
......@@ -777,6 +777,10 @@ module API
expose :squash
expose :task_completion_status
expose :cannot_be_merged?, as: :has_conflicts
expose :mergeable_discussions_state?, as: :blocking_discussions_resolved
end
class MergeRequest < MergeRequestBasic
......
......@@ -775,6 +775,8 @@ describe API::MergeRequests do
expect(json_response['merge_error']).to eq(merge_request.merge_error)
expect(json_response['user']['can_merge']).to be_truthy
expect(json_response).not_to include('rebase_in_progress')
expect(json_response['has_conflicts']).to be_falsy
expect(json_response['blocking_discussions_resolved']).to be_truthy
end
it 'exposes description and title html when render_html is true' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment