-
- Downloads
Fix a wrong MR status when merge_when_build_succeeds &...
Fix a wrong MR status when merge_when_build_succeeds & project.only_allow_merge_if_build_succeeds are true
The issue was that `MergeRequest#mergeable?` returns false when the CI
state is not success and project.only_allow_merge_if_build_succeeds is
true. In this case `Projects::MergeRequestsController#merge` would
return the `:failed` status when enabling `merge_when_build_succeeds`,
thus leading to a weird state and the MR never automatically merged.
The fix is to disable the CI state check in the controller safeguard
that early return the `:failed` status.
Signed-off-by:
Rémy Coutable <remy@rymai.me>
Showing
- CHANGELOG 1 addition, 0 deletionsCHANGELOG
- app/controllers/projects/merge_requests_controller.rb 8 additions, 1 deletionapp/controllers/projects/merge_requests_controller.rb
- app/models/merge_request.rb 4 additions, 4 deletionsapp/models/merge_request.rb
- spec/controllers/projects/merge_requests_controller_spec.rb 12 additions, 0 deletionsspec/controllers/projects/merge_requests_controller_spec.rb
Please register or sign in to comment