diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2016-12-05 14:07:57 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2016-12-05 14:07:57 +0300 |
commit | 0f90fd639c9ed387426e0a8ec3a23ac33b37024c (patch) | |
tree | fe5951138e06bfcccd4f2474ef773078896e2f0e /app/controllers/projects | |
parent | ca075c918a2eceaa02fa8b2ff2da4434c0900b2d (diff) | |
parent | 4681ab1df1c3d05af58335dd065ae1834aab5d35 (diff) |
Merge branch 'fix/rename-mwbs-to-merge-when-pipeline-succeeds' into 'master'
Rename MWBS service to Merge When Pipeline Succeeds
## What does this MR do?
This MR renames Merge When Build Succeeds feature to Merge When Pipeline Succeeds, because we recently changed the behavior, see https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6675.
## Does this MR meet the acceptance criteria?
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] All builds are passing
## What are the relevant issue numbers?
Closes #23354
See merge request !7135
Diffstat (limited to 'app/controllers/projects')
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index d2cef52842c..f0cb5a9d4b4 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -302,9 +302,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController end def cancel_merge_when_build_succeeds - return access_denied! unless @merge_request.can_cancel_merge_when_build_succeeds?(current_user) + unless @merge_request.can_cancel_merge_when_build_succeeds?(current_user) + return access_denied! + end - MergeRequests::MergeWhenBuildSucceedsService.new(@project, current_user).cancel(@merge_request) + MergeRequests::MergeWhenPipelineSucceedsService + .new(@project, current_user) + .cancel(@merge_request) end def merge @@ -331,8 +335,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController end if @merge_request.head_pipeline.active? - MergeRequests::MergeWhenBuildSucceedsService.new(@project, current_user, merge_params) - .execute(@merge_request) + MergeRequests::MergeWhenPipelineSucceedsService + .new(@project, current_user, merge_params) + .execute(@merge_request) + @status = :merge_when_build_succeeds elsif @merge_request.head_pipeline.success? # This can be triggered when a user clicks the auto merge button while |