diff options
author | James Lopez <james@gitlab.com> | 2019-05-07 16:06:53 +0000 |
---|---|---|
committer | James Lopez <james@gitlab.com> | 2019-05-07 16:06:53 +0000 |
commit | 47e5eedc5c3b09d631143848228e7f70388c6f85 (patch) | |
tree | c23954af03947e8af936e2c6428340c28dbf3aab /lib | |
parent | f0ff33d8bf3c0fd2dae4f6c762f161b127aa88d7 (diff) | |
parent | 29f9d92642539eaa04bdb485425d6f1cd3b459fd (diff) | |
download | gitlab-ce-47e5eedc5c3b09d631143848228e7f70388c6f85.tar.gz |
Merge branch '55127-add-delay-after-mr-creation-for-async-tasks-to-complete' into 'master'
Confirm pipeline existence when accepting a MR
Closes #55127
See merge request gitlab-org/gitlab-ce!27978
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/merge_requests.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index ce85772e4ed..daa98c22e5e 100644 --- a/lib/api/merge_requests.rb +++ b/lib/api/merge_requests.rb @@ -367,6 +367,10 @@ module API merge_request = find_project_merge_request(params[:merge_request_iid]) merge_when_pipeline_succeeds = to_boolean(params[:merge_when_pipeline_succeeds]) + if merge_when_pipeline_succeeds || merge_request.merge_when_pipeline_succeeds + render_api_error!('Not allowed: pipeline does not exist', 405) unless merge_request.head_pipeline + end + # Merge request can not be merged # because user dont have permissions to push into target branch unauthorized! unless merge_request.can_be_merged_by?(current_user) |