Commit a64354db authored by James Lopez's avatar James Lopez

Merge branch 'mc/bug/omips-not-blocking-on-skipped-pipelines' into 'master'

Block MR with OMIPS on skipped pipelines

Closes #30059

See merge request gitlab-org/gitlab!18838
parents 1b4453d9 24cd6f64
......@@ -1081,7 +1081,7 @@ class MergeRequest < ApplicationRecord
return true unless project.only_allow_merge_if_pipeline_succeeds?
return false unless actual_head_pipeline
actual_head_pipeline.success? || actual_head_pipeline.skipped?
actual_head_pipeline.success?
end
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
context 'when CI skipped' do
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)
wait_for_requests
expect(page).to have_button 'Merge'
expect(page).not_to have_button 'Merge'
end
end
end
......
......@@ -2267,7 +2267,7 @@ describe MergeRequest do
allow(subject).to receive(:head_pipeline) { pipeline }
end
it { expect(subject.mergeable_ci_state?).to be_truthy }
it { expect(subject.mergeable_ci_state?).to be_falsey }
end
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