From fe66cf40eff4999467a0ad7e37a1817630d255ef Mon Sep 17 00:00:00 2001 From: Aakriti Gupta Date: Wed, 31 Jan 2024 18:14:07 +0530 Subject: [PATCH] Remove geo proxy related dev feature flags Changelog: other EE: true --- .../geo_proxy_direct_to_primary.yml | 8 - .../geo_proxy_fetch_direct_to_primary.yml | 8 - ee/lib/ee/gitlab/geo_git_access.rb | 4 +- ee/spec/lib/gitlab/git_access_spec.rb | 150 ------------------ 4 files changed, 2 insertions(+), 168 deletions(-) delete mode 100644 ee/config/feature_flags/development/geo_proxy_direct_to_primary.yml delete mode 100644 ee/config/feature_flags/development/geo_proxy_fetch_direct_to_primary.yml diff --git a/ee/config/feature_flags/development/geo_proxy_direct_to_primary.yml b/ee/config/feature_flags/development/geo_proxy_direct_to_primary.yml deleted file mode 100644 index efd7ec23ca14ab..00000000000000 --- a/ee/config/feature_flags/development/geo_proxy_direct_to_primary.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: geo_proxy_direct_to_primary -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111888 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/391407 -milestone: '15.10' -type: development -group: group::geo -default_enabled: true diff --git a/ee/config/feature_flags/development/geo_proxy_fetch_direct_to_primary.yml b/ee/config/feature_flags/development/geo_proxy_fetch_direct_to_primary.yml deleted file mode 100644 index ef90303e7762b6..00000000000000 --- a/ee/config/feature_flags/development/geo_proxy_fetch_direct_to_primary.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: geo_proxy_fetch_direct_to_primary -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/127069 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/418329 -milestone: '16.3' -type: development -group: group::geo -default_enabled: true diff --git a/ee/lib/ee/gitlab/geo_git_access.rb b/ee/lib/ee/gitlab/geo_git_access.rb index 96f2b711ec381f..27d26e8d93ecde 100644 --- a/ee/lib/ee/gitlab/geo_git_access.rb +++ b/ee/lib/ee/gitlab/geo_git_access.rb @@ -18,8 +18,8 @@ def geo_custom_action 'data' => { 'api_endpoints' => custom_action_api_endpoints_for(cmd), 'primary_repo' => primary_http_repo_internal_url, - 'geo_proxy_direct_to_primary' => ::Feature.enabled?(:geo_proxy_direct_to_primary), - 'geo_proxy_fetch_direct_to_primary' => ::Feature.enabled?(:geo_proxy_fetch_direct_to_primary), + 'geo_proxy_direct_to_primary' => true, + 'geo_proxy_fetch_direct_to_primary' => true, 'geo_proxy_fetch_direct_to_primary_with_options' => ::Feature.enabled?( :geo_proxy_fetch_direct_to_primary_with_options ), diff --git a/ee/spec/lib/gitlab/git_access_spec.rb b/ee/spec/lib/gitlab/git_access_spec.rb index a058e77748b49d..98b0e761e99670 100644 --- a/ee/spec/lib/gitlab/git_access_spec.rb +++ b/ee/spec/lib/gitlab/git_access_spec.rb @@ -696,56 +696,6 @@ def download_ability expect(response.payload).to include(expected_payload) expect(response.console_messages).to eq(expected_console_messages) end - - context 'with the feature flag geo_proxy_direct_to_primary disabled' do - it 'returns a custom action' do - stub_feature_flags(geo_proxy_direct_to_primary: false) - - expected_payload = { - "action" => "geo_proxy_to_primary", - "data" => { - "api_endpoints" => ["/api/v4/geo/proxy_git_ssh/info_refs_upload_pack", "/api/v4/geo/proxy_git_ssh/upload_pack"], - "primary_repo" => geo_primary_http_internal_url_to_repo(project_no_repo), - "geo_proxy_direct_to_primary" => false, - "geo_proxy_fetch_direct_to_primary" => true, - "geo_proxy_fetch_direct_to_primary_with_options" => true, - "request_headers" => include('Authorization') - } - } - expected_console_messages = ["This request to a Geo secondary node will be forwarded to the", "Geo primary node:", "", " #{geo_primary_ssh_url_to_repo(project)}"] - - response = pull_changes - - expect(response).to be_instance_of(Gitlab::GitAccessResult::CustomAction) - expect(response.payload).to include(expected_payload) - expect(response.console_messages).to eq(expected_console_messages) - end - end - - context 'with the feature flag geo_proxy_fetch_direct_to_primary disabled' do - it 'returns a custom action' do - stub_feature_flags(geo_proxy_fetch_direct_to_primary: false) - - expected_payload = { - "action" => "geo_proxy_to_primary", - "data" => { - "api_endpoints" => ["/api/v4/geo/proxy_git_ssh/info_refs_upload_pack", "/api/v4/geo/proxy_git_ssh/upload_pack"], - "primary_repo" => geo_primary_http_internal_url_to_repo(project_no_repo), - "geo_proxy_direct_to_primary" => true, - "geo_proxy_fetch_direct_to_primary" => false, - "geo_proxy_fetch_direct_to_primary_with_options" => true, - "request_headers" => include('Authorization') - } - } - expected_console_messages = ["This request to a Geo secondary node will be forwarded to the", "Geo primary node:", "", " #{geo_primary_ssh_url_to_repo(project)}"] - - response = pull_changes - - expect(response).to be_instance_of(Gitlab::GitAccessResult::CustomAction) - expect(response.payload).to include(expected_payload) - expect(response.console_messages).to eq(expected_console_messages) - end - end end end end @@ -842,56 +792,6 @@ def download_ability expect(response.payload).to include(expected_payload) expect(response.console_messages).to eq(expected_console_messages) end - - context 'with the feature flag geo_proxy_direct_to_primary disabled' do - it 'returns a custom action' do - stub_feature_flags(geo_proxy_direct_to_primary: false) - - expected_payload = { - "action" => "geo_proxy_to_primary", - "data" => { - "api_endpoints" => ["/api/v4/geo/proxy_git_ssh/info_refs_receive_pack", "/api/v4/geo/proxy_git_ssh/receive_pack"], - "primary_repo" => geo_primary_http_internal_url_to_repo(project), - "geo_proxy_direct_to_primary" => false, - "geo_proxy_fetch_direct_to_primary" => true, - "geo_proxy_fetch_direct_to_primary_with_options" => true, - "request_headers" => include('Authorization') - } - } - expected_console_messages = ["This request to a Geo secondary node will be forwarded to the", "Geo primary node:", "", " #{geo_primary_ssh_url_to_repo(project)}"] - - response = push_changes - - expect(response).to be_instance_of(Gitlab::GitAccessResult::CustomAction) - expect(response.payload).to include(expected_payload) - expect(response.console_messages).to eq(expected_console_messages) - end - end - - context 'with the feature flag geo_proxy_fetch_direct_to_primary disabled' do - it 'returns a custom action' do - stub_feature_flags(geo_proxy_fetch_direct_to_primary: false) - - expected_payload = { - "action" => "geo_proxy_to_primary", - "data" => { - "api_endpoints" => ["/api/v4/geo/proxy_git_ssh/info_refs_receive_pack", "/api/v4/geo/proxy_git_ssh/receive_pack"], - "primary_repo" => geo_primary_http_internal_url_to_repo(project), - "geo_proxy_direct_to_primary" => true, - "geo_proxy_fetch_direct_to_primary" => false, - "geo_proxy_fetch_direct_to_primary_with_options" => true, - "request_headers" => include('Authorization') - } - } - expected_console_messages = ["This request to a Geo secondary node will be forwarded to the", "Geo primary node:", "", " #{geo_primary_ssh_url_to_repo(project)}"] - - response = push_changes - - expect(response).to be_instance_of(Gitlab::GitAccessResult::CustomAction) - expect(response.payload).to include(expected_payload) - expect(response.console_messages).to eq(expected_console_messages) - end - end end context 'when the actor is a user' do @@ -917,56 +817,6 @@ def download_ability expect(response.payload).to include(expected_payload) expect(response.console_messages).to eq(expected_console_messages) end - - context 'with the feature flag geo_proxy_direct_to_primary disabled' do - it 'returns a custom action' do - stub_feature_flags(geo_proxy_direct_to_primary: false) - - expected_payload = { - "action" => "geo_proxy_to_primary", - "data" => { - "api_endpoints" => ["/api/v4/geo/proxy_git_ssh/info_refs_receive_pack", "/api/v4/geo/proxy_git_ssh/receive_pack"], - "primary_repo" => geo_primary_http_internal_url_to_repo(project), - "geo_proxy_direct_to_primary" => false, - "geo_proxy_fetch_direct_to_primary" => true, - "geo_proxy_fetch_direct_to_primary_with_options" => true, - "request_headers" => include('Authorization') - } - } - expected_console_messages = ["This request to a Geo secondary node will be forwarded to the", "Geo primary node:", "", " #{geo_primary_ssh_url_to_repo(project)}"] - - response = push_changes - - expect(response).to be_instance_of(Gitlab::GitAccessResult::CustomAction) - expect(response.payload).to include(expected_payload) - expect(response.console_messages).to eq(expected_console_messages) - end - end - - context 'with the feature flag geo_proxy_fetch_direct_to_primary disabled' do - it 'returns a custom action' do - stub_feature_flags(geo_proxy_fetch_direct_to_primary: false) - - expected_payload = { - "action" => "geo_proxy_to_primary", - "data" => { - "api_endpoints" => ["/api/v4/geo/proxy_git_ssh/info_refs_receive_pack", "/api/v4/geo/proxy_git_ssh/receive_pack"], - "primary_repo" => geo_primary_http_internal_url_to_repo(project), - "geo_proxy_direct_to_primary" => true, - "geo_proxy_fetch_direct_to_primary" => false, - "geo_proxy_fetch_direct_to_primary_with_options" => true, - "request_headers" => include('Authorization') - } - } - expected_console_messages = ["This request to a Geo secondary node will be forwarded to the", "Geo primary node:", "", " #{geo_primary_ssh_url_to_repo(project)}"] - - response = push_changes - - expect(response).to be_instance_of(Gitlab::GitAccessResult::CustomAction) - expect(response.payload).to include(expected_payload) - expect(response.console_messages).to eq(expected_console_messages) - end - end end end end -- GitLab