diff --git a/.rubocop_todo/style/class_and_module_children.yml b/.rubocop_todo/style/class_and_module_children.yml index f620f034ac2777891ab11750bc87764a20de985c..51df00e3b3e612d01ec67f7422860807d5cc2751 100644 --- a/.rubocop_todo/style/class_and_module_children.yml +++ b/.rubocop_todo/style/class_and_module_children.yml @@ -344,7 +344,6 @@ Style/ClassAndModuleChildren: - 'ee/app/controllers/admin/elasticsearch_controller.rb' - 'ee/app/controllers/admin/emails_controller.rb' - 'ee/app/controllers/admin/geo/application_controller.rb' - - 'ee/app/controllers/admin/geo/designs_controller.rb' - 'ee/app/controllers/admin/geo/nodes_controller.rb' - 'ee/app/controllers/admin/geo/replicables_controller.rb' - 'ee/app/controllers/admin/geo/settings_controller.rb' diff --git a/.rubocop_todo/style/empty_method.yml b/.rubocop_todo/style/empty_method.yml index f7120a87472a81b54d08d7fdfa6c348aa75367ac..99da84146c7e197e440c5c0c77faf45d9479db9d 100644 --- a/.rubocop_todo/style/empty_method.yml +++ b/.rubocop_todo/style/empty_method.yml @@ -65,7 +65,6 @@ Style/EmptyMethod: - 'app/services/projects/transfer_service.rb' - 'app/workers/namespaces/root_statistics_worker.rb' - 'ee/app/controllers/admin/emails_controller.rb' - - 'ee/app/controllers/admin/geo/designs_controller.rb' - 'ee/app/controllers/admin/geo/settings_controller.rb' - 'ee/app/controllers/admin/push_rules_controller.rb' - 'ee/app/controllers/groups/analytics/ci_cd_analytics_controller.rb' diff --git a/doc/api/geo_nodes.md b/doc/api/geo_nodes.md index 566f9f5b1b0588d7ddee7bcc4e808014585aa54e..2ecacfb5c05cad18842d5689aa69f8ce8da78252 100644 --- a/doc/api/geo_nodes.md +++ b/doc/api/geo_nodes.md @@ -72,7 +72,6 @@ Example response: "sync_object_storage": false, "clone_protocol": "http", "web_edit_url": "https://primary.example.com/admin/geo/sites/3/edit", - "web_geo_projects_url": "https://secondary.example.com/admin/geo/projects", "web_geo_replication_details_url": "https://secondary.example.com/admin/geo/sites/3/replication/lfs_objects", "_links": { "self": "https://primary.example.com/api/v4/geo_nodes/3", @@ -82,10 +81,6 @@ Example response: } ``` -WARNING: -The `web_geo_projects_url` attribute is in its end-of-life process. It is [deprecated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/80106) -in GitLab 14.9. - ## Retrieve configuration about all Geo nodes ```plaintext @@ -143,7 +138,6 @@ Example response: "sync_object_storage": true, "clone_protocol": "http", "web_edit_url": "https://primary.example.com/admin/geo/sites/2/edit", - "web_geo_projects_url": "https://secondary.example.com/admin/geo/projects", "web_geo_replication_details_url": "https://secondary.example.com/admin/geo/sites/2/replication/lfs_objects", "_links": { "self":"https://primary.example.com/api/v4/geo_nodes/2", @@ -154,10 +148,6 @@ Example response: ] ``` -WARNING: -The `web_geo_projects_url` attribute is in its end-of-life process. It is [deprecated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/80106) -in GitLab 14.9. - ## Retrieve configuration about a specific Geo node ```plaintext @@ -244,7 +234,6 @@ Example response: "sync_object_storage": true, "clone_protocol": "http", "web_edit_url": "https://primary.example.com/admin/geo/sites/2/edit", - "web_geo_projects_url": "https://secondary.example.com/admin/geo/projects", "web_geo_replication_details_url": "https://secondary.example.com/admin/geo/sites/2/replication/lfs_objects", "_links": { "self":"https://primary.example.com/api/v4/geo_nodes/2", @@ -254,10 +243,6 @@ Example response: } ``` -WARNING: -The `web_geo_projects_url` attribute is in its end-of-life process. It is [deprecated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/80106) -in GitLab 14.9. - ## Delete a Geo node Removes the Geo node. diff --git a/ee/app/controllers/admin/geo/designs_controller.rb b/ee/app/controllers/admin/geo/designs_controller.rb deleted file mode 100644 index cbbccf248d751c807449d792f8700345a8f26174..0000000000000000000000000000000000000000 --- a/ee/app/controllers/admin/geo/designs_controller.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class Admin::Geo::DesignsController < Admin::Geo::ApplicationController - before_action :check_license! - before_action :load_node_data, only: [:index] - - def index - redirect_to admin_geo_nodes_path unless @current_node - redirect_to design_management_repositories_path - end - - def design_management_repositories_path - "/admin/geo/sites/#{@current_node.id}/replication/design_management_repositories" - end -end diff --git a/ee/app/controllers/admin/geo/projects_controller.rb b/ee/app/controllers/admin/geo/projects_controller.rb deleted file mode 100644 index 171646c311ab932c674e45d691038b2041d567df..0000000000000000000000000000000000000000 --- a/ee/app/controllers/admin/geo/projects_controller.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module Admin - module Geo - class ProjectsController < Admin::Geo::ApplicationController - before_action :check_license! - before_action :limited_actions_message! - before_action :load_node_data, only: [:index] - - def index - redirect_to admin_geo_nodes_path unless @current_node - redirect_to project_repositories_path - end - - private - - def project_repositories_path - "/admin/geo/sites/#{@current_node.id}/replication/project_repositories" - end - end - end -end diff --git a/ee/app/helpers/ee/geo_helper.rb b/ee/app/helpers/ee/geo_helper.rb index 51d92a9287c64e309e8635b77d7bbbe505a9246a..23a8b437ead9ba05b53d6d1a811633ba441ac419 100644 --- a/ee/app/helpers/ee/geo_helper.rb +++ b/ee/app/helpers/ee/geo_helper.rb @@ -67,22 +67,33 @@ def geo_filter_nav_options(replicable_controller, replicable_name) { value: '', text: sprintf(s_('Geo|All %{replicable_name}'), { replicable_name: replicable_name }), - href: url_for(controller: replicable_controller) + href: url_for( + controller: replicable_controller, + replicable_name_plural: replicable_name) }, { value: 'pending', text: s_('Geo|In progress'), - href: url_for(controller: replicable_controller, sync_status: 'pending') + href: url_for( + controller: replicable_controller, + replicable_name_plural: replicable_name, + sync_status: 'pending') }, { value: 'failed', text: s_('Geo|Failed'), - href: url_for(controller: replicable_controller, sync_status: 'failed') + href: url_for( + controller: replicable_controller, + replicable_name_plural: replicable_name, + sync_status: 'failed') }, { value: 'synced', text: s_('Geo|Synced'), - href: url_for(controller: replicable_controller, sync_status: 'synced') + href: url_for( + controller: replicable_controller, + replicable_name_plural: replicable_name, + sync_status: 'synced') } ] end diff --git a/ee/app/models/geo_node.rb b/ee/app/models/geo_node.rb index 6c66b07bce77fc5159cdc3bacad23c3e867a3a6c..16bfb2cd9504bac1e4e9f1191c6ac93e9d64d96a 100644 --- a/ee/app/models/geo_node.rb +++ b/ee/app/models/geo_node.rb @@ -218,12 +218,6 @@ def oauth_logout_url(state) Gitlab::Routing.url_helpers.oauth_geo_logout_url(url_helper_args.merge(state: state)) end - def geo_projects_url - return unless self.secondary? - - Gitlab::Routing.url_helpers.admin_geo_projects_url(url_helper_args) - end - def geo_replication_details_url return unless self.secondary? diff --git a/ee/config/routes/admin.rb b/ee/config/routes/admin.rb index e560cf6f4e2876a1e3a4c6390b77b388d685b2af..31ee2c3e54df1d2e1404144dfea99e33a0c03d5e 100644 --- a/ee/config/routes/admin.rb +++ b/ee/config/routes/admin.rb @@ -72,21 +72,6 @@ scope '/replication' do get '/', to: redirect(path: 'admin/geo/sites') - - resources :projects, only: [:index, :destroy] do - member do - post :reverify - post :resync - end - - collection do - post :reverify_all - post :resync_all - end - end - - resources :designs, only: [:index] - get '/:replicable_name_plural', to: 'replicables#index', as: 'replicables' end diff --git a/ee/lib/ee/api/entities/geo_node.rb b/ee/lib/ee/api/entities/geo_node.rb index e4bcafa7b7b8d913856655cee4cc0b840941f983..0bb527974204d6c0b9ebc3e599f4d443520e1e86 100644 --- a/ee/lib/ee/api/entities/geo_node.rb +++ b/ee/lib/ee/api/entities/geo_node.rb @@ -34,11 +34,6 @@ class GeoNode < Grape::Entity ::Gitlab::Routing.url_helpers.edit_admin_geo_node_url(geo_node) end - # @deprecated in favor of web_geo_replication_details_url - expose :web_geo_projects_url, if: ->(geo_node, _) { geo_node.secondary? } do |geo_node| - geo_node.geo_projects_url - end - expose :web_geo_replication_details_url, if: ->(geo_node, _) { geo_node.secondary? } do |geo_node| geo_node.geo_replication_details_url end diff --git a/ee/spec/controllers/admin/geo/designs_controller_spec.rb b/ee/spec/controllers/admin/geo/designs_controller_spec.rb deleted file mode 100644 index 8ea3a8f658c78f271420bf3bb20beec5ae60f7ea..0000000000000000000000000000000000000000 --- a/ee/spec/controllers/admin/geo/designs_controller_spec.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Admin::Geo::DesignsController, :geo, feature_category: :geo_replication do - include EE::GeoHelpers - - describe 'GET #index' do - let_it_be(:node) { create(:geo_node) } - - before do - stub_current_geo_node(node) - stub_licensed_features(geo: true) - sign_in(create(:admin)) - end - - shared_examples 'redirects /admin/geo/replication/designs' do - it do - get :index - - expect(response).to have_gitlab_http_status(:redirect) - expect(response).to redirect_to( - "/admin/geo/sites/#{node.id}/replication/design_management_repositories" - ) - end - end - - context 'on primary' do - before do - stub_primary_node - end - - it_behaves_like 'redirects /admin/geo/replication/designs' - end - - context 'on secondary' do - before do - stub_secondary_node - end - - it_behaves_like 'redirects /admin/geo/replication/designs' - end - end -end diff --git a/ee/spec/controllers/admin/geo/projects_controller_spec.rb b/ee/spec/controllers/admin/geo/projects_controller_spec.rb deleted file mode 100644 index a89a0caac5935fadbc088745285e30115f84840d..0000000000000000000000000000000000000000 --- a/ee/spec/controllers/admin/geo/projects_controller_spec.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Admin::Geo::ProjectsController, :geo, feature_category: :geo_replication do - include EE::GeoHelpers - - let_it_be(:admin) { create(:admin) } - let_it_be(:geo_node) { create(:geo_node, :primary) } - - before do - sign_in(admin) - end - - shared_examples 'license required' do - context 'without a valid license' do - it 'redirects to 403 page' do - expect(subject).to have_gitlab_http_status(:forbidden) - end - end - end - - describe '#index' do - subject { get :index } - - it_behaves_like 'license required' - - context 'with a valid license' do - render_views - - before do - stub_licensed_features(geo: true) - stub_current_geo_node(geo_node) - end - - shared_examples 'redirects /admin/geo/replication/projects' do - it do - get :index - - expect(response).to have_gitlab_http_status(:redirect) - expect(response).to redirect_to( - "/admin/geo/sites/#{geo_node.id}/replication/project_repositories" - ) - end - end - - context 'on primary' do - before do - stub_primary_node - end - - it_behaves_like 'redirects /admin/geo/replication/projects' - end - - context 'on secondary' do - before do - stub_secondary_node - end - - it_behaves_like 'redirects /admin/geo/replication/projects' - end - end - end -end diff --git a/ee/spec/features/admin/geo/admin_geo_replication_nav_spec.rb b/ee/spec/features/admin/geo/admin_geo_replication_nav_spec.rb index d9897b62c695f5bcc4cc88fe824d5752f50ed216..f6dd4059d0747d4f4ea58cb7590c8a78901bb11f 100644 --- a/ee/spec/features/admin/geo/admin_geo_replication_nav_spec.rb +++ b/ee/spec/features/admin/geo/admin_geo_replication_nav_spec.rb @@ -37,7 +37,7 @@ end it 'displays enabled replicator replication details nav links' do - visit admin_geo_replicables_path(replicable_name_plural: 'projects') + visit admin_geo_replicables_path(replicable_name_plural: 'project_repositories') Gitlab::Geo.enabled_replicator_classes.each do |replicator_class| navbar = page.find(".gl-tabs-nav") diff --git a/ee/spec/features/admin/geo/admin_geo_sidebar_spec.rb b/ee/spec/features/admin/geo/admin_geo_sidebar_spec.rb index 9ef40a1011c4d1ccc5b5e6532a7febe2871b3f90..71f3bfa4ddf82d69f4966dbbc05b338e86370451 100644 --- a/ee/spec/features/admin/geo/admin_geo_sidebar_spec.rb +++ b/ee/spec/features/admin/geo/admin_geo_sidebar_spec.rb @@ -51,12 +51,6 @@ stub_secondary_node end - describe 'visiting geo projects' do - it_behaves_like 'active sidebar link', 'Sites' do - let(:path) { admin_geo_projects_path } - end - end - describe 'visiting geo replicables' do Gitlab::Geo.enabled_replicator_classes.each do |replicator_class| it_behaves_like 'active sidebar link', 'Sites' do diff --git a/ee/spec/fixtures/api/schemas/public_api/v4/geo_node.json b/ee/spec/fixtures/api/schemas/public_api/v4/geo_node.json index 81bfb02f8af1908260c1d3462aadd79b0b5b61ef..b385397672bacd4cbf397f63445602ff246041a1 100644 --- a/ee/spec/fixtures/api/schemas/public_api/v4/geo_node.json +++ b/ee/spec/fixtures/api/schemas/public_api/v4/geo_node.json @@ -1,6 +1,6 @@ { "type": "object", - "required" : [ + "required": [ "id", "name", "url", @@ -19,44 +19,107 @@ "web_edit_url", "_links" ], - "properties" : { - "id": { "type": "integer" }, - "name": { "type": ["string", "null"] }, - "url": { "type": ["string", "null"] }, - "primary": { "type": "boolean" }, - "internal_url": { "type": ["string", "null"] }, - "enabled": { "type": "boolean" }, - "current": { "type": "boolean" }, - "files_max_capacity": { "type": "integer" }, - "repos_max_capacity": { "type": "integer" }, - "verification_max_capacity": { "type": "integer" }, - "container_repositories_max_capacity": { "type": "integer" }, - "selective_sync_type": { "type": ["string", "null"] }, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "url": { + "type": [ + "string", + "null" + ] + }, + "primary": { + "type": "boolean" + }, + "internal_url": { + "type": [ + "string", + "null" + ] + }, + "enabled": { + "type": "boolean" + }, + "current": { + "type": "boolean" + }, + "files_max_capacity": { + "type": "integer" + }, + "repos_max_capacity": { + "type": "integer" + }, + "verification_max_capacity": { + "type": "integer" + }, + "container_repositories_max_capacity": { + "type": "integer" + }, + "selective_sync_type": { + "type": [ + "string", + "null" + ] + }, "selective_sync_shards": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "string" } }, "selective_sync_namespace_ids": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "integer" } }, - "minimum_reverification_interval": { "type": "integer" }, - "sync_object_storage" : { "type": "boolean" }, - "clone_protocol": { "type": "string" }, - "web_edit_url": { "type": "string" }, - "web_geo_projects_url": { "type": ["string", "null"] }, - "web_geo_replication_details_url" : { "type": ["string", "null"] }, + "minimum_reverification_interval": { + "type": "integer" + }, + "sync_object_storage": { + "type": "boolean" + }, + "clone_protocol": { + "type": "string" + }, + "web_edit_url": { + "type": "string" + }, + "web_geo_replication_details_url": { + "type": [ + "string", + "null" + ] + }, "_links": { "type": "object", - "required": ["self", "repair"], - "properties" : { - "self": { "type": "string" }, - "status": { "type": "string" }, - "repair": { "type": "string" } + "required": [ + "self", + "repair" + ], + "properties": { + "self": { + "type": "string" + }, + "status": { + "type": "string" + }, + "repair": { + "type": "string" + } }, "additionalProperties": false } diff --git a/ee/spec/frontend/geo_sites/mock_data.js b/ee/spec/frontend/geo_sites/mock_data.js index 1ffa2f3adb27fcec95e7c7d63dcddd9e5819df3e..24181387b558361bbdc71ee4cb9ccb7b978fa893 100644 --- a/ee/spec/frontend/geo_sites/mock_data.js +++ b/ee/spec/frontend/geo_sites/mock_data.js @@ -268,7 +268,6 @@ export const MOCK_SECONDARY_SITE = { version: '10.4.0-pre', revision: 'b93c51849b', storageShardsMatch: true, - webGeoProjectsUrl: 'http://127.0.0.1:3002/replication/projects', webGeoReplicationDetailsUrl: 'http://127.0.0.1:3002/admin/geo/sites/2/replication/lfs_objects', }; @@ -338,7 +337,6 @@ export const MOCK_SECONDARY_SITE_STATUSES_RES = { version: '10.4.0-pre', revision: 'b93c51849b', storage_shards_match: true, - web_geo_projects_url: 'http://127.0.0.1:3002/replication/projects', web_geo_replication_details_url: 'http://127.0.0.1:3002/admin/geo/sites/2/replication/lfs_objects', }; diff --git a/ee/spec/helpers/ee/geo_helper_spec.rb b/ee/spec/helpers/ee/geo_helper_spec.rb index 3115d0ac4a0c62a74ec5d9b5c50eba727de19a22..346fda8049caf63fe65bda6a140ec7420d0b0cb4 100644 --- a/ee/spec/helpers/ee/geo_helper_spec.rb +++ b/ee/spec/helpers/ee/geo_helper_spec.rb @@ -52,7 +52,7 @@ end describe '#geo_filter_nav_options' do - let(:replicable_controller) { 'admin/geo/projects' } + let(:replicable_controller) { 'admin/geo/replicables' } let(:replicable_name) { 'projects' } let(:expected_nav_options) do [ diff --git a/ee/spec/models/geo_node_spec.rb b/ee/spec/models/geo_node_spec.rb index bf73ec7e32ae87dd89a2b09dcf09be4a19fd86b1..8ef11737632c37ee3caedb0e2b39a9f67278805c 100644 --- a/ee/spec/models/geo_node_spec.rb +++ b/ee/spec/models/geo_node_spec.rb @@ -642,18 +642,6 @@ end end - describe '#geo_projects_url' do - it 'returns the Geo Projects url for the specific node' do - expected_url = 'https://localhost:3000/gitlab/admin/geo/replication/projects' - - expect(new_node.geo_projects_url).to eq(expected_url) - end - - it 'returns nil when node is a primary one' do - expect(primary_node.geo_projects_url).to be_nil - end - end - describe '#geo_replication_details_url' do before do allow(Gitlab::Geo).to receive(:enabled_replicator_classes).and_return( diff --git a/ee/spec/routing/admin_routing_spec.rb b/ee/spec/routing/admin_routing_spec.rb index 81751ce470de1735cc4491cf4f2095285f6ec571..2f3a0727c407e26f601f55f0af298dc5002b8de7 100644 --- a/ee/spec/routing/admin_routing_spec.rb +++ b/ee/spec/routing/admin_routing_spec.rb @@ -2,18 +2,6 @@ require 'spec_helper' RSpec.describe 'EE-specific admin routing' do - describe Admin::Geo::ProjectsController, 'routing' do - it 'routes / to #index' do - expect(get('/admin/geo/replication/projects')).to route_to('admin/geo/projects#index') - end - end - - describe Admin::Geo::DesignsController, 'routing' do - it 'routes / to #index' do - expect(get('/admin/geo/replication/designs')).to route_to('admin/geo/designs#index') - end - end - describe Admin::Geo::ReplicablesController, 'routing' do Gitlab::Geo.enabled_replicator_classes.map(&:replicable_name_plural).each do |replicable_name_plural| it "routes /admin/geo/replication/#{replicable_name_plural} to replicables#index" do diff --git a/ee/spec/support/shared_examples/lib/gitlab/middleware/allowlisted_admin_geo_requests_shared_examples.rb b/ee/spec/support/shared_examples/lib/gitlab/middleware/allowlisted_admin_geo_requests_shared_examples.rb index f88369da8a05712fe86eb78fa1b2e5bbf59befb0..39c223d254e1ddb8d6c21f0db3d36dceb0caccef 100644 --- a/ee/spec/support/shared_examples/lib/gitlab/middleware/allowlisted_admin_geo_requests_shared_examples.rb +++ b/ee/spec/support/shared_examples/lib/gitlab/middleware/allowlisted_admin_geo_requests_shared_examples.rb @@ -12,15 +12,5 @@ context 'allowlisted requests' do it_behaves_like 'allowlisted request', :patch, '/admin/geo/sites/1' - - it_behaves_like 'allowlisted request', :delete, '/admin/geo/replication/projects/1' - - it_behaves_like 'allowlisted request', :post, '/admin/geo/replication/projects/1/resync' - - it_behaves_like 'allowlisted request', :post, '/admin/geo/replication/projects/1/reverify' - - it_behaves_like 'allowlisted request', :post, '/admin/geo/replication/projects/reverify_all' - - it_behaves_like 'allowlisted request', :post, '/admin/geo/replication/projects/resync_all' end end