Commit fb83b82c authored by Stan Hu's avatar Stan Hu

Merge branch '60250-remove-mr_push_options-flag' into 'master'

Remove the mr_push_options feature flag

Closes #60250

See merge request gitlab-org/gitlab-ce!28278
parents 76c8d4fb 48a6cb7f
---
title: Remove the mr_push_options feature flag
merge_request: 28278
author:
type: changed
...@@ -46,6 +46,8 @@ module API ...@@ -46,6 +46,8 @@ module API
def process_mr_push_options(push_options, project, user, changes) def process_mr_push_options(push_options, project, user, changes)
output = {} output = {}
Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/61359')
service = ::MergeRequests::PushOptionsHandlerService.new( service = ::MergeRequests::PushOptionsHandlerService.new(
project, project,
user, user,
......
...@@ -264,12 +264,8 @@ module API ...@@ -264,12 +264,8 @@ module API
PostReceive.perform_async(params[:gl_repository], params[:identifier], PostReceive.perform_async(params[:gl_repository], params[:identifier],
params[:changes], push_options.as_json) params[:changes], push_options.as_json)
if Feature.enabled?(:mr_push_options, default_enabled: true) mr_options = push_options.get(:merge_request)
Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/61359') output.merge!(process_mr_push_options(mr_options, project, user, params[:changes])) if mr_options.present?
mr_options = push_options.get(:merge_request)
output.merge!(process_mr_push_options(mr_options, project, user, params[:changes])) if mr_options.present?
end
broadcast_message = BroadcastMessage.current&.last&.message broadcast_message = BroadcastMessage.current&.last&.message
reference_counter_decreased = Gitlab::ReferenceCounter.new(params[:gl_repository]).decrease reference_counter_decreased = Gitlab::ReferenceCounter.new(params[:gl_repository]).decrease
......
...@@ -997,18 +997,6 @@ describe API::Internal do ...@@ -997,18 +997,6 @@ describe API::Internal do
expect(json_response['warnings']).to eq('Error encountered with push options \'merge_request.create\': my error') expect(json_response['warnings']).to eq('Error encountered with push options \'merge_request.create\': my error')
end end
context 'when the feature is disabled' do
it 'does not invoke MergeRequests::PushOptionsHandlerService' do
stub_feature_flags(mr_push_options: false)
expect(MergeRequests::PushOptionsHandlerService).not_to receive(:new)
expect do
post api('/internal/post_receive'), params: valid_params
end.not_to change { MergeRequest.count }
end
end
end end
context 'broadcast message exists' do context 'broadcast message exists' 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