summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2019-05-21 18:14:22 -0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2019-05-31 19:16:01 -0300
commitb965009ddddcd50e76841dbc97d2767292e88a0a (patch)
tree5c8e87e5c96454ee0cf918a5b7b878ee95d5ed4b /doc/api
parent15916ad55920ca582a9124f7f0737b0373432a99 (diff)
downloadgitlab-ce-b965009ddddcd50e76841dbc97d2767292e88a0a.tar.gz
Automatically update MR merge-ref along merge status
This couples the code that transitions the `MergeRequest#merge_status` and refs/merge-requests/:iid/merge ref update. In general, instead of directly telling `MergeToRefService` to update the merge ref, we should rely on `MergeabilityCheckService` to keep both the merge status and merge ref synced. Now, if the merge_status is `can_be_merged` it means the merge-ref is also updated to the latest. We've also updated the logic to be more systematic and less user-based.
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/merge_requests.md20
1 files changed, 8 insertions, 12 deletions
diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md
index 7992af15448..08d57307279 100644
--- a/doc/api/merge_requests.md
+++ b/doc/api/merge_requests.md
@@ -1159,33 +1159,29 @@ Parameters:
}
```
-## Merge to default merge ref path
+## Return up to date merge-ref
Merge the changes between the merge request source and target branches into `refs/merge-requests/:iid/merge`
-ref, of the target project repository. This ref will have the state the target branch would have if
+ref, of the target project repository, if possible. This ref will have the state the target branch would have if
a regular merge action was taken.
-This is not a regular merge action given it doesn't change the merge request state in any manner.
+This is not a regular merge action given it doesn't change the merge request target branch state in any manner.
-This ref (`refs/merge-requests/:iid/merge`) is **always** overwritten when submitting
-requests to this API, so none of its state is kept or used in the process.
+This ref (`refs/merge-requests/:iid/merge`) isn't necessarily overwritten when submitting
+requests to this API, though it'll make sure the ref has the latest possible state.
-If the merge request has conflicts, is empty or already merged,
-you'll get a `400` and a descriptive error message. If you don't have permissions to do so,
-you'll get a `403`.
+If the merge request has conflicts, is empty or already merged, you'll get a `400` and a descriptive error message.
-It returns the HEAD commit of `refs/merge-requests/:iid/merge` in the response body in
-case of `200`.
+It returns the HEAD commit of `refs/merge-requests/:iid/merge` in the response body in case of `200`.
```
-PUT /projects/:id/merge_requests/:merge_request_iid/merge_to_ref
+GET /projects/:id/merge_requests/:merge_request_iid/merge_ref
```
Parameters:
- `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user
- `merge_request_iid` (required) - Internal ID of MR
-- `merge_commit_message` (optional) - Custom merge commit message
```json
{