Commit 1f646ea8 authored by Patrick Bajao's avatar Patrick Bajao

Remove early_prepare_for_mergeability feature flag

The feature flag was enabled on production for more than a week
now. Looking at https://log.gprd.gitlab.net/goto/11419880-87d8-11ec-a649-b7cbb8e4f62e,
the errors that are occuring are still related to Gitaly timeout.

Those errors happens after the MR is prepared for mergeability
which is why we prepare for mergeability earlier. This way even if
the rest of the job fails, the MR will already be checked for
mergeability.

This removes the feature flag and enables the early check for all.

Changelog: changed
parent 0e6bedd9
......@@ -5,9 +5,8 @@ module MergeRequests
include Gitlab::Utils::StrongMemoize
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)
check_mergeability(merge_request) unless early_prepare_for_mergeability?(merge_request)
end
private
......@@ -26,11 +25,6 @@ module MergeRequests
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.create_cross_references!(current_user)
......@@ -49,12 +43,6 @@ module MergeRequests
LinkLfsObjectsService.new(project: merge_request.target_project).execute(merge_request)
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)
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
expect { execute_service }.to raise_error(StandardError)
expect(merge_request.reload).to be_preparing
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
context 'when preparing merge request fails' do
......@@ -134,17 +123,6 @@ RSpec.describe MergeRequests::AfterCreateService do
expect(merge_request).to receive(:check_mergeability).with(async: true)
expect { execute_service }.to raise_error(StandardError)
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
......
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