Commit 24cd6f64 authored by Matija Čupić's avatar Matija Čupić Committed by James Lopez

Block MR with OMIPS on skipped pipelines

parent 1b4453d9
...@@ -1081,7 +1081,7 @@ class MergeRequest < ApplicationRecord ...@@ -1081,7 +1081,7 @@ class MergeRequest < ApplicationRecord
return true unless project.only_allow_merge_if_pipeline_succeeds? return true unless project.only_allow_merge_if_pipeline_succeeds?
return false unless actual_head_pipeline return false unless actual_head_pipeline
actual_head_pipeline.success? || actual_head_pipeline.skipped? actual_head_pipeline.success?
end end
def environments_for(current_user) def environments_for(current_user)
......
---
title: Block MR with OMIPS on skipped pipelines.
merge_request: 18838
author:
type: fixed
...@@ -89,12 +89,12 @@ describe 'Merge request > User merges only if pipeline succeeds', :js do ...@@ -89,12 +89,12 @@ describe 'Merge request > User merges only if pipeline succeeds', :js do
context 'when CI skipped' do context 'when CI skipped' do
let(:status) { :skipped } let(:status) { :skipped }
it 'allows MR to be merged' do it 'does not allow MR to be merged' do
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
wait_for_requests wait_for_requests
expect(page).to have_button 'Merge' expect(page).not_to have_button 'Merge'
end end
end end
end end
......
...@@ -2267,7 +2267,7 @@ describe MergeRequest do ...@@ -2267,7 +2267,7 @@ describe MergeRequest do
allow(subject).to receive(:head_pipeline) { pipeline } allow(subject).to receive(:head_pipeline) { pipeline }
end end
it { expect(subject.mergeable_ci_state?).to be_truthy } it { expect(subject.mergeable_ci_state?).to be_falsey }
end end
context 'when no pipeline is associated' do context 'when no pipeline is associated' 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