From 515f3eb44ab6e11c124dc4a7cc34c94e765783d5 Mon Sep 17 00:00:00 2001 From: Luke Duncalfe Date: Sun, 12 May 2019 18:47:15 -0500 Subject: Remove the mr_push_options feature flag `Gitlab::QueryLimiting.whitelist` has been moved from being inside the feature flag conditional check to the `process_mr_push_options` `Api::Internal` helper. https://gitlab.com/gitlab-org/gitlab-ce/issues/60250 --- lib/api/helpers/internal_helpers.rb | 2 ++ lib/api/internal.rb | 8 ++------ spec/requests/api/internal_spec.rb | 12 ------------ 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/lib/api/helpers/internal_helpers.rb b/lib/api/helpers/internal_helpers.rb index 71c30ec99a5..c318f5b9127 100644 --- a/lib/api/helpers/internal_helpers.rb +++ b/lib/api/helpers/internal_helpers.rb @@ -46,6 +46,8 @@ module API def process_mr_push_options(push_options, project, user, changes) output = {} + Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/61359') + service = ::MergeRequests::PushOptionsHandlerService.new( project, user, diff --git a/lib/api/internal.rb b/lib/api/internal.rb index c82fd230d7a..224aaaaf006 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -264,12 +264,8 @@ module API PostReceive.perform_async(params[:gl_repository], params[:identifier], params[:changes], push_options.as_json) - if Feature.enabled?(:mr_push_options, default_enabled: true) - Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/61359') - - mr_options = push_options.get(:merge_request) - output.merge!(process_mr_push_options(mr_options, project, user, params[:changes])) if mr_options.present? - end + mr_options = push_options.get(:merge_request) + output.merge!(process_mr_push_options(mr_options, project, user, params[:changes])) if mr_options.present? broadcast_message = BroadcastMessage.current&.last&.message reference_counter_decreased = Gitlab::ReferenceCounter.new(params[:gl_repository]).decrease diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb index bae0302f3ff..fcbff19bd61 100644 --- a/spec/requests/api/internal_spec.rb +++ b/spec/requests/api/internal_spec.rb @@ -997,18 +997,6 @@ describe API::Internal do expect(json_response['warnings']).to eq('Error encountered with push options \'merge_request.create\': my error') 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 context 'broadcast message exists' do -- cgit v1.2.1 From 48a6cb7f519c74ceddf7a2670c534b57f02c85ca Mon Sep 17 00:00:00 2001 From: Luke Duncalfe Date: Fri, 17 May 2019 13:48:20 +1200 Subject: Add changelog entry --- changelogs/unreleased/60250-remove-mr_push_options-flag.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelogs/unreleased/60250-remove-mr_push_options-flag.yml diff --git a/changelogs/unreleased/60250-remove-mr_push_options-flag.yml b/changelogs/unreleased/60250-remove-mr_push_options-flag.yml new file mode 100644 index 00000000000..b429d83dcc7 --- /dev/null +++ b/changelogs/unreleased/60250-remove-mr_push_options-flag.yml @@ -0,0 +1,5 @@ +--- +title: Remove the mr_push_options feature flag +merge_request: 28278 +author: +type: changed -- cgit v1.2.1