Commit a9688b34 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Remove some deprecated global routes

Remove deprecated /abuse_reports, /invites,
/sent_notifications, /autocomplete routes.
Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 4fbfaff7
---
title: Remove some deprecated global routes
merge_request: 34295
author:
type: removed
...@@ -252,38 +252,6 @@ Rails.application.routes.draw do ...@@ -252,38 +252,6 @@ Rails.application.routes.draw do
end end
end end
# Deprecated routes.
# Will be removed as part of https://gitlab.com/gitlab-org/gitlab/-/issues/210024
scope as: :deprecated do
# Autocomplete
get '/autocomplete/users' => 'autocomplete#users'
get '/autocomplete/users/:id' => 'autocomplete#user'
get '/autocomplete/projects' => 'autocomplete#projects'
get '/autocomplete/award_emojis' => 'autocomplete#award_emojis'
get '/autocomplete/merge_request_target_branches' => 'autocomplete#merge_request_target_branches'
Gitlab.ee do
get '/autocomplete/project_groups' => 'autocomplete#project_groups'
get '/autocomplete/project_routes' => 'autocomplete#project_routes'
get '/autocomplete/namespace_routes' => 'autocomplete#namespace_routes'
end
resources :invites, only: [:show], constraints: { id: /[A-Za-z0-9_-]+/ } do
member do
post :accept
match :decline, via: [:get, :post]
end
end
resources :sent_notifications, only: [], constraints: { id: /\h{32}/ } do
member do
get :unsubscribe
end
end
resources :abuse_reports, only: [:new, :create]
end
resources :groups, only: [:index, :new, :create] do resources :groups, only: [:index, :new, :create] do
post :preview_markdown post :preview_markdown
end end
......
...@@ -54,13 +54,11 @@ Currently the following names are reserved as top level groups: ...@@ -54,13 +54,11 @@ Currently the following names are reserved as top level groups:
- `500.html` - `500.html`
- `502.html` - `502.html`
- `503.html` - `503.html`
- `abuse_reports`
- `admin` - `admin`
- `api` - `api`
- `apple-touch-icon-precomposed.png` - `apple-touch-icon-precomposed.png`
- `apple-touch-icon.png` - `apple-touch-icon.png`
- `assets` - `assets`
- `autocomplete`
- `dashboard` - `dashboard`
- `deploy.html` - `deploy.html`
- `explore` - `explore`
...@@ -71,7 +69,6 @@ Currently the following names are reserved as top level groups: ...@@ -71,7 +69,6 @@ Currently the following names are reserved as top level groups:
- `health_check` - `health_check`
- `help` - `help`
- `import` - `import`
- `invites`
- `jwt` - `jwt`
- `login` - `login`
- `oauth` - `oauth`
...@@ -81,7 +78,6 @@ Currently the following names are reserved as top level groups: ...@@ -81,7 +78,6 @@ Currently the following names are reserved as top level groups:
- `robots.txt` - `robots.txt`
- `s` - `s`
- `search` - `search`
- `sent_notifications`
- `sitemap` - `sitemap`
- `sitemap.xml` - `sitemap.xml`
- `sitemap.xml.gz` - `sitemap.xml.gz`
......
...@@ -21,13 +21,11 @@ module Gitlab ...@@ -21,13 +21,11 @@ module Gitlab
500.html 500.html
502.html 502.html
503.html 503.html
abuse_reports
admin admin
api api
apple-touch-icon-precomposed.png apple-touch-icon-precomposed.png
apple-touch-icon.png apple-touch-icon.png
assets assets
autocomplete
dashboard dashboard
deploy.html deploy.html
explore explore
...@@ -38,7 +36,6 @@ module Gitlab ...@@ -38,7 +36,6 @@ module Gitlab
health_check health_check
help help
import import
invites
jwt jwt
login login
oauth oauth
...@@ -48,7 +45,6 @@ module Gitlab ...@@ -48,7 +45,6 @@ module Gitlab
robots.txt robots.txt
s s
search search
sent_notifications
sitemap sitemap
sitemap.xml sitemap.xml
sitemap.xml.gz sitemap.xml.gz
......
...@@ -183,7 +183,7 @@ RSpec.describe Gitlab::PathRegex do ...@@ -183,7 +183,7 @@ RSpec.describe Gitlab::PathRegex do
# We ban new items in this list, see https://gitlab.com/gitlab-org/gitlab/-/issues/215362 # We ban new items in this list, see https://gitlab.com/gitlab-org/gitlab/-/issues/215362
it 'does not allow expansion' do it 'does not allow expansion' do
expect(described_class::TOP_LEVEL_ROUTES.size).to eq(44) expect(described_class::TOP_LEVEL_ROUTES.size).to eq(40)
end end
end end
......
...@@ -335,10 +335,6 @@ RSpec.describe InvitesController, 'routing' do ...@@ -335,10 +335,6 @@ RSpec.describe InvitesController, 'routing' do
it 'to #show' do it 'to #show' do
expect(get("/-/invites/#{member.invite_token}")).to route_to('invites#show', id: member.invite_token) expect(get("/-/invites/#{member.invite_token}")).to route_to('invites#show', id: member.invite_token)
end end
it 'to legacy route' do
expect(get("/invites/#{member.invite_token}")).to route_to('invites#show', id: member.invite_token)
end
end end
RSpec.describe AbuseReportsController, 'routing' do RSpec.describe AbuseReportsController, 'routing' do
...@@ -347,10 +343,6 @@ RSpec.describe AbuseReportsController, 'routing' do ...@@ -347,10 +343,6 @@ RSpec.describe AbuseReportsController, 'routing' do
it 'to #new' do it 'to #new' do
expect(get("/-/abuse_reports/new?user_id=#{user.id}")).to route_to('abuse_reports#new', user_id: user.id.to_s) expect(get("/-/abuse_reports/new?user_id=#{user.id}")).to route_to('abuse_reports#new', user_id: user.id.to_s)
end end
it 'to legacy route' do
expect(get("/abuse_reports/new?user_id=#{user.id}")).to route_to('abuse_reports#new', user_id: user.id.to_s)
end
end end
RSpec.describe SentNotificationsController, 'routing' do RSpec.describe SentNotificationsController, 'routing' do
...@@ -376,12 +368,6 @@ RSpec.describe AutocompleteController, 'routing' do ...@@ -376,12 +368,6 @@ RSpec.describe AutocompleteController, 'routing' do
it 'to #merge_request_target_branches' do it 'to #merge_request_target_branches' do
expect(get("/-/autocomplete/merge_request_target_branches")).to route_to('autocomplete#merge_request_target_branches') expect(get("/-/autocomplete/merge_request_target_branches")).to route_to('autocomplete#merge_request_target_branches')
end end
it 'to legacy route' do
expect(get("/autocomplete/users")).to route_to('autocomplete#users')
expect(get("/autocomplete/projects")).to route_to('autocomplete#projects')
expect(get("/autocomplete/award_emojis")).to route_to('autocomplete#award_emojis')
end
end end
RSpec.describe Snippets::BlobsController, "routing" do RSpec.describe Snippets::BlobsController, "routing" 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