Commit 1bd7f7cb authored by Stan Hu's avatar Stan Hu

Revert "Merge branch '28682-can-merge-branch-before-build-is-started' into 'master'"

This reverts commit 793be43b, reversing
changes made to 8d0b4872.

For projects not using any CI, enabling merge only when pipeline succeeds
caused merge requests to be in unmergeable state, which caused significant
confusion.

See https://gitlab.com/gitlab-org/gitlab-ce/issues/55144 for more details.
parent 185f8a5d
...@@ -978,6 +978,7 @@ class MergeRequest < ActiveRecord::Base ...@@ -978,6 +978,7 @@ class MergeRequest < ActiveRecord::Base
def mergeable_ci_state? def mergeable_ci_state?
return true unless project.only_allow_merge_if_pipeline_succeeds? return true unless project.only_allow_merge_if_pipeline_succeeds?
return true unless head_pipeline
actual_head_pipeline&.success? || actual_head_pipeline&.skipped? actual_head_pipeline&.success? || actual_head_pipeline&.skipped?
end end
......
---
title: Strictly require a pipeline to merge.
merge_request: 22911
author:
type: changed
...@@ -1885,7 +1885,7 @@ describe MergeRequest do ...@@ -1885,7 +1885,7 @@ describe MergeRequest do
allow(subject).to receive(:head_pipeline) { nil } allow(subject).to receive(:head_pipeline) { nil }
end end
it { expect(subject.mergeable_ci_state?).to be_falsey } it { expect(subject.mergeable_ci_state?).to be_truthy }
end end
end end
......
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