Commit 4fce6c45 authored by Stan Hu's avatar Stan Hu

Merge branch '346667-remove-early-prepare-for-mergeability-ff' into 'master'

Remove early_prepare_for_mergeability feature flag

See merge request gitlab-org/gitlab!80042
parents a1750624 1f646ea8
...@@ -5,9 +5,8 @@ module MergeRequests ...@@ -5,9 +5,8 @@ module MergeRequests
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
def execute(merge_request) def execute(merge_request)
prepare_for_mergeability(merge_request) if early_prepare_for_mergeability?(merge_request) prepare_for_mergeability(merge_request)
prepare_merge_request(merge_request) prepare_merge_request(merge_request)
check_mergeability(merge_request) unless early_prepare_for_mergeability?(merge_request)
end end
private private
...@@ -26,11 +25,6 @@ module MergeRequests ...@@ -26,11 +25,6 @@ module MergeRequests
notification_service.new_merge_request(merge_request, current_user) notification_service.new_merge_request(merge_request, current_user)
unless early_prepare_for_mergeability?(merge_request)
create_pipeline_for(merge_request, current_user)
merge_request.update_head_pipeline
end
merge_request.diffs(include_stats: false).write_cache merge_request.diffs(include_stats: false).write_cache
merge_request.create_cross_references!(current_user) merge_request.create_cross_references!(current_user)
...@@ -49,12 +43,6 @@ module MergeRequests ...@@ -49,12 +43,6 @@ module MergeRequests
LinkLfsObjectsService.new(project: merge_request.target_project).execute(merge_request) LinkLfsObjectsService.new(project: merge_request.target_project).execute(merge_request)
end end
def early_prepare_for_mergeability?(merge_request)
strong_memoize("early_prepare_for_mergeability_#{merge_request.target_project_id}".to_sym) do
Feature.enabled?(:early_prepare_for_mergeability, merge_request.target_project)
end
end
def check_mergeability(merge_request) def check_mergeability(merge_request)
return unless merge_request.preparing? return unless merge_request.preparing?
......
---
name: early_prepare_for_mergeability
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75402
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/346667
milestone: '14.6'
type: development
group: group::code review
default_enabled: false
...@@ -108,17 +108,6 @@ RSpec.describe MergeRequests::AfterCreateService do ...@@ -108,17 +108,6 @@ RSpec.describe MergeRequests::AfterCreateService do
expect { execute_service }.to raise_error(StandardError) expect { execute_service }.to raise_error(StandardError)
expect(merge_request.reload).to be_preparing expect(merge_request.reload).to be_preparing
end end
context 'when early_prepare_for_mergeability feature flag is disabled' do
before do
stub_feature_flags(early_prepare_for_mergeability: false)
end
it 'does not mark the merge request as unchecked' do
expect { execute_service }.to raise_error(StandardError)
expect(merge_request.reload).to be_preparing
end
end
end end
context 'when preparing merge request fails' do context 'when preparing merge request fails' do
...@@ -134,17 +123,6 @@ RSpec.describe MergeRequests::AfterCreateService do ...@@ -134,17 +123,6 @@ RSpec.describe MergeRequests::AfterCreateService do
expect(merge_request).to receive(:check_mergeability).with(async: true) expect(merge_request).to receive(:check_mergeability).with(async: true)
expect { execute_service }.to raise_error(StandardError) expect { execute_service }.to raise_error(StandardError)
end end
context 'when early_prepare_for_mergeability feature flag is disabled' do
before do
stub_feature_flags(early_prepare_for_mergeability: false)
end
it 'does not mark the merge request as unchecked' do
expect { execute_service }.to raise_error(StandardError)
expect(merge_request.reload).to be_preparing
end
end
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