Commit 260102b2 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '14584-remove-routes-that-we-do-not-use-anymore' into 'master'

Resolve "Remove routes that we do not use anymore"

_Originally opened at !4059 by @strzibny._

- - -

## What does this MR do?

> I tried to clean up the routes as mentioned in #14584
I used the following script and manually verified the changes: https://gist.github.com/strzibny/4ccbda7dcf67ef6719dcb047014e1ea7
After this patch, the script still gives me the following routes:
Unused routes (7): oauth/authorizations#show doorkeeper/tokens#create doorkeeper/tokens#revoke oauth/applications#edit oauth/applications#show doorkeeper/token_info#show omniauth_callbacks#(?-mix:(?!))
Here is a relevant code from doorkeeper on drawing these routes: https://github.com/doorkeeper-gem/doorkeeper/blob/5ea4575863781940fe6996692c6b41f2ad71d90e/lib/doorkeeper/rails/routes.rb#L25

## What are the relevant issue numbers?

Closes #14584.

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)


See merge request !5499
parents f88bb5a5 774997e9
...@@ -6,6 +6,7 @@ v 8.11.0 (unreleased) ...@@ -6,6 +6,7 @@ v 8.11.0 (unreleased)
- Fix of 'Commits being passed to custom hooks are already reachable when using the UI' - Fix of 'Commits being passed to custom hooks are already reachable when using the UI'
- Add support for using RequestStore within Sidekiq tasks via SIDEKIQ_REQUEST_STORE env variable - Add support for using RequestStore within Sidekiq tasks via SIDEKIQ_REQUEST_STORE env variable
- Limit git rev-list output count to one in forced push check - Limit git rev-list output count to one in forced push check
- Clean up unused routes (Josef Strzibny)
- Add green outline to New Branch button. !5447 (winniehell) - Add green outline to New Branch button. !5447 (winniehell)
- Retrieve rendered HTML from cache in one request - Retrieve rendered HTML from cache in one request
- Nokogiri's various parsing methods are now instrumented - Nokogiri's various parsing methods are now instrumented
......
...@@ -42,10 +42,9 @@ Rails.application.routes.draw do ...@@ -42,10 +42,9 @@ Rails.application.routes.draw do
resource :lint, only: [:show, :create] resource :lint, only: [:show, :create]
resources :projects do resources :projects, only: [:index, :show] do
member do member do
get :status, to: 'projects#badge' get :status, to: 'projects#badge'
get :integration
end end
end end
...@@ -144,13 +143,13 @@ Rails.application.routes.draw do ...@@ -144,13 +143,13 @@ Rails.application.routes.draw do
get :jobs get :jobs
end end
resource :gitlab, only: [:create, :new], controller: :gitlab do resource :gitlab, only: [:create], controller: :gitlab do
get :status get :status
get :callback get :callback
get :jobs get :jobs
end end
resource :bitbucket, only: [:create, :new], controller: :bitbucket do resource :bitbucket, only: [:create], controller: :bitbucket do
get :status get :status
get :callback get :callback
get :jobs get :jobs
...@@ -243,7 +242,6 @@ Rails.application.routes.draw do ...@@ -243,7 +242,6 @@ Rails.application.routes.draw do
get :projects get :projects
get :keys get :keys
get :groups get :groups
put :team_update
put :block put :block
put :unblock put :unblock
put :unlock put :unlock
...@@ -301,7 +299,7 @@ Rails.application.routes.draw do ...@@ -301,7 +299,7 @@ Rails.application.routes.draw do
end end
end end
resource :appearances, path: 'appearance' do resource :appearances, only: [:show, :create, :update], path: 'appearance' do
member do member do
get :preview get :preview
delete :logo delete :logo
...@@ -310,7 +308,7 @@ Rails.application.routes.draw do ...@@ -310,7 +308,7 @@ Rails.application.routes.draw do
end end
resource :application_settings, only: [:show, :update] do resource :application_settings, only: [:show, :update] do
resources :services resources :services, only: [:index, :edit, :update]
put :reset_runners_token put :reset_runners_token
put :reset_health_check_token put :reset_health_check_token
put :clear_repository_check_states put :clear_repository_check_states
...@@ -347,7 +345,7 @@ Rails.application.routes.draw do ...@@ -347,7 +345,7 @@ Rails.application.routes.draw do
end end
scope module: :profiles do scope module: :profiles do
resource :account, only: [:show, :update] do resource :account, only: [:show] do
member do member do
delete :unlink delete :unlink
end end
...@@ -359,7 +357,7 @@ Rails.application.routes.draw do ...@@ -359,7 +357,7 @@ Rails.application.routes.draw do
end end
end end
resource :preferences, only: [:show, :update] resource :preferences, only: [:show, :update]
resources :keys resources :keys, only: [:index, :show, :new, :create, :destroy]
resources :emails, only: [:index, :create, :destroy] resources :emails, only: [:index, :create, :destroy]
resource :avatar, only: [:destroy] resource :avatar, only: [:destroy]
...@@ -661,7 +659,7 @@ Rails.application.routes.draw do ...@@ -661,7 +659,7 @@ Rails.application.routes.draw do
post '/wikis/*id/markdown_preview', to: 'wikis#markdown_preview', constraints: WIKI_SLUG_ID, as: 'wiki_markdown_preview' post '/wikis/*id/markdown_preview', to: 'wikis#markdown_preview', constraints: WIKI_SLUG_ID, as: 'wiki_markdown_preview'
end end
resource :repository, only: [:show, :create] do resource :repository, only: [:create] do
member do member do
get 'archive', constraints: { format: Gitlab::Regex.archive_formats_regex } get 'archive', constraints: { format: Gitlab::Regex.archive_formats_regex }
end end
...@@ -783,7 +781,7 @@ Rails.application.routes.draw do ...@@ -783,7 +781,7 @@ Rails.application.routes.draw do
end end
end end
resources :labels, constraints: { id: /\d+/ } do resources :labels, except: [:show], constraints: { id: /\d+/ } do
collection do collection do
post :generate post :generate
post :set_priorities post :set_priorities
...@@ -808,7 +806,7 @@ Rails.application.routes.draw do ...@@ -808,7 +806,7 @@ Rails.application.routes.draw do
end end
end end
resources :project_members, except: [:new, :edit], constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ }, concerns: :access_requestable do resources :project_members, except: [:show, :new, :edit], constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ }, concerns: :access_requestable do
collection do collection do
delete :leave delete :leave
......
require 'spec_helper' require 'spec_helper'
# team_update_admin_user PUT /admin/users/:id/team_update(.:format) admin/users#team_update
# block_admin_user PUT /admin/users/:id/block(.:format) admin/users#block # block_admin_user PUT /admin/users/:id/block(.:format) admin/users#block
# unblock_admin_user PUT /admin/users/:id/unblock(.:format) admin/users#unblock # unblock_admin_user PUT /admin/users/:id/unblock(.:format) admin/users#unblock
# admin_users GET /admin/users(.:format) admin/users#index # admin_users GET /admin/users(.:format) admin/users#index
...@@ -11,10 +10,6 @@ require 'spec_helper' ...@@ -11,10 +10,6 @@ require 'spec_helper'
# PUT /admin/users/:id(.:format) admin/users#update # PUT /admin/users/:id(.:format) admin/users#update
# DELETE /admin/users/:id(.:format) admin/users#destroy # DELETE /admin/users/:id(.:format) admin/users#destroy
describe Admin::UsersController, "routing" do describe Admin::UsersController, "routing" do
it "to #team_update" do
expect(put("/admin/users/1/team_update")).to route_to('admin/users#team_update', id: '1')
end
it "to #block" do it "to #block" do
expect(put("/admin/users/1/block")).to route_to('admin/users#block', id: '1') expect(put("/admin/users/1/block")).to route_to('admin/users#block', id: '1')
end end
......
...@@ -135,10 +135,6 @@ describe Projects::RepositoriesController, 'routing' do ...@@ -135,10 +135,6 @@ describe Projects::RepositoriesController, 'routing' do
it 'to #archive format:tar.bz2' do it 'to #archive format:tar.bz2' do
expect(get('/gitlab/gitlabhq/repository/archive.tar.bz2')).to route_to('projects/repositories#archive', namespace_id: 'gitlab', project_id: 'gitlabhq', format: 'tar.bz2') expect(get('/gitlab/gitlabhq/repository/archive.tar.bz2')).to route_to('projects/repositories#archive', namespace_id: 'gitlab', project_id: 'gitlabhq', format: 'tar.bz2')
end end
it 'to #show' do
expect(get('/gitlab/gitlabhq/repository')).to route_to('projects/repositories#show', namespace_id: 'gitlab', project_id: 'gitlabhq')
end
end end
describe Projects::BranchesController, 'routing' do describe Projects::BranchesController, 'routing' do
......
...@@ -176,18 +176,10 @@ describe Profiles::KeysController, "routing" do ...@@ -176,18 +176,10 @@ describe Profiles::KeysController, "routing" do
expect(post("/profile/keys")).to route_to('profiles/keys#create') expect(post("/profile/keys")).to route_to('profiles/keys#create')
end end
it "to #edit" do
expect(get("/profile/keys/1/edit")).to route_to('profiles/keys#edit', id: '1')
end
it "to #show" do it "to #show" do
expect(get("/profile/keys/1")).to route_to('profiles/keys#show', id: '1') expect(get("/profile/keys/1")).to route_to('profiles/keys#show', id: '1')
end end
it "to #update" do
expect(put("/profile/keys/1")).to route_to('profiles/keys#update', id: '1')
end
it "to #destroy" do it "to #destroy" do
expect(delete("/profile/keys/1")).to route_to('profiles/keys#destroy', id: '1') expect(delete("/profile/keys/1")).to route_to('profiles/keys#destroy', id: '1')
end end
......
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