summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-06-25 18:37:47 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-06-26 09:18:13 +0300
commit9be95e2b2f72ca481848823d3856b4518fd9743a (patch)
tree86a2c8d6d6086bef124f31fd64a049e2486e9b8d
parentf904971e5fefff92b0cc467a4dc4483ba68b6e6c (diff)
downloadgitlab-ce-9be95e2b2f72ca481848823d3856b4518fd9743a.tar.gz
Remove deprecated /u/:username routesdz-remove-deprecated-user-routes
Also release `u` from TOP_LEVEL_ROUTES Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--app/assets/javascripts/pages/users/user_tabs.js4
-rw-r--r--changelogs/unreleased/dz-remove-deprecated-user-routes.yml5
-rw-r--r--config/routes/snippets.rb2
-rw-r--r--config/routes/user.rb9
-rw-r--r--doc/api/merge_request_approvals.md8
-rw-r--r--doc/university/process/README.md6
-rw-r--r--lib/gitlab/path_regex.rb1
-rw-r--r--spec/routing/routing_spec.rb30
-rw-r--r--spec/support/helpers/jira_service_helper.rb4
9 files changed, 24 insertions, 45 deletions
diff --git a/app/assets/javascripts/pages/users/user_tabs.js b/app/assets/javascripts/pages/users/user_tabs.js
index 7f800d20835..1d8b388e935 100644
--- a/app/assets/javascripts/pages/users/user_tabs.js
+++ b/app/assets/javascripts/pages/users/user_tabs.js
@@ -18,12 +18,12 @@ import UserOverviewBlock from './user_overview_block';
*
* <ul class="nav-links">
* <li class="activity-tab active">
- * <a data-action="activity" data-target="#activity" data-toggle="tab" href="/u/username">
+ * <a data-action="activity" data-target="#activity" data-toggle="tab" href="/username">
* Activity
* </a>
* </li>
* <li class="groups-tab">
- * <a data-action="groups" data-target="#groups" data-toggle="tab" href="/u/username/groups">
+ * <a data-action="groups" data-target="#groups" data-toggle="tab" href="/users/username/groups">
* Groups
* </a>
* </li>
diff --git a/changelogs/unreleased/dz-remove-deprecated-user-routes.yml b/changelogs/unreleased/dz-remove-deprecated-user-routes.yml
new file mode 100644
index 00000000000..92c2e39dd20
--- /dev/null
+++ b/changelogs/unreleased/dz-remove-deprecated-user-routes.yml
@@ -0,0 +1,5 @@
+---
+title: Remove depreated /u/:username routing
+merge_request: 30044
+author:
+type: removed
diff --git a/config/routes/snippets.rb b/config/routes/snippets.rb
index 81bc890d86b..ba6da3ac57e 100644
--- a/config/routes/snippets.rb
+++ b/config/routes/snippets.rb
@@ -17,5 +17,5 @@ resources :snippets, concerns: :awardable do
end
end
-get '/s/:username', to: redirect('u/%{username}/snippets'),
+get '/s/:username', to: redirect('users/%{username}/snippets'),
constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }
diff --git a/config/routes/user.rb b/config/routes/user.rb
index e0ae264e2c0..f93a3fc6161 100644
--- a/config/routes/user.rb
+++ b/config/routes/user.rb
@@ -48,15 +48,6 @@ scope(constraints: { username: Gitlab::PathRegex.root_namespace_route_regex }) d
get :activity
get '/', to: redirect('%{username}'), as: nil
end
-
- # Compatibility with old routing
- # TODO (dzaporozhets): remove in 10.0
- get '/u/:username', to: redirect('%{username}')
- # TODO (dzaporozhets): remove in 9.0
- get '/u/:username/groups', to: redirect('users/%{username}/groups')
- get '/u/:username/projects', to: redirect('users/%{username}/projects')
- get '/u/:username/snippets', to: redirect('users/%{username}/snippets')
- get '/u/:username/contributed', to: redirect('users/%{username}/contributed')
end
constraints(::Constraints::UserUrlConstrainer.new) do
diff --git a/doc/api/merge_request_approvals.md b/doc/api/merge_request_approvals.md
index ddac81328b9..49aaac06b46 100644
--- a/doc/api/merge_request_approvals.md
+++ b/doc/api/merge_request_approvals.md
@@ -222,7 +222,7 @@ GET /projects/:id/merge_requests/:merge_request_iid/approvals
"id": 1,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon",
- "web_url": "http://localhost:3000/u/root"
+ "web_url": "http://localhost:3000/root"
}
}
],
@@ -314,7 +314,7 @@ PUT /projects/:id/merge_requests/:merge_request_iid/approvers
"id": 1,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon",
- "web_url": "http://localhost:3000/u/root"
+ "web_url": "http://localhost:3000/root"
}
}
],
@@ -387,7 +387,7 @@ does not match, the response code will be `409`.
"id": 1,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon",
- "web_url": "http://localhost:3000/u/root"
+ "web_url": "http://localhost:3000/root"
}
},
{
@@ -397,7 +397,7 @@ does not match, the response code will be `409`.
"id": 2,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/cf7ad14b34162a76d593e3affca2adca?s=80\u0026d=identicon",
- "web_url": "http://localhost:3000/u/ryley"
+ "web_url": "http://localhost:3000/ryley"
}
}
],
diff --git a/doc/university/process/README.md b/doc/university/process/README.md
index fdf6224f7f6..b278e02ccd5 100644
--- a/doc/university/process/README.md
+++ b/doc/university/process/README.md
@@ -9,11 +9,11 @@ title: University | Process
# Suggesting improvements
If you would like to teach a class or participate or help in any way please
-submit a merge request and assign it to [Job](https://gitlab.com/u/JobV).
+submit a merge request and assign it to [Job](https://gitlab.com/JobV).
If you have suggestions for additional courses you would like to see,
please submit a merge request to add an upcoming class, assign to
-[Chad](https://gitlab.com/u/chadmalchow) and /cc [Job](https://gitlab.com/u/JobV).
+[Chad](https://gitlab.com/chadmalchow) and /cc [Job](https://gitlab.com/JobV).
## Adding classes
@@ -31,4 +31,4 @@ please submit a merge request to add an upcoming class, assign to
1. Please upload any video recordings to our Youtube channel. We prefer them to
be public, if needed they can be unlisted but if so they should be linked from
this page.
-1. Please create a merge request and assign to [Erica](https://gitlab.com/u/Erica).
+1. Please create a merge request and assign to [Erica](https://gitlab.com/Erica).
diff --git a/lib/gitlab/path_regex.rb b/lib/gitlab/path_regex.rb
index a07b1246bee..a13b3f9e069 100644
--- a/lib/gitlab/path_regex.rb
+++ b/lib/gitlab/path_regex.rb
@@ -53,7 +53,6 @@ module Gitlab
sent_notifications
slash-command-logo.png
snippets
- u
unsubscribes
uploads
users
diff --git a/spec/routing/routing_spec.rb b/spec/routing/routing_spec.rb
index a170bb14144..ff4228c9b99 100644
--- a/spec/routing/routing_spec.rb
+++ b/spec/routing/routing_spec.rb
@@ -1,12 +1,12 @@
require 'spec_helper'
-# user GET /u/:username/
-# user_groups GET /u/:username/groups(.:format)
-# user_projects GET /u/:username/projects(.:format)
-# user_contributed_projects GET /u/:username/contributed(.:format)
-# user_snippets GET /u/:username/snippets(.:format)
-# user_calendar GET /u/:username/calendar(.:format)
-# user_calendar_activities GET /u/:username/calendar_activities(.:format)
+# user GET /users/:username/
+# user_groups GET /users/:username/groups(.:format)
+# user_projects GET /users/:username/projects(.:format)
+# user_contributed_projects GET /users/:username/contributed(.:format)
+# user_snippets GET /users/:username/snippets(.:format)
+# user_calendar GET /users/:username/calendar(.:format)
+# user_calendar_activities GET /users/:username/calendar_activities(.:format)
describe UsersController, "routing" do
it "to #show" do
allow_any_instance_of(::Constraints::UserUrlConstrainer).to receive(:matches?).and_return(true)
@@ -37,22 +37,6 @@ describe UsersController, "routing" do
it "to #calendar_activities" do
expect(get("/users/User/calendar_activities")).to route_to('users#calendar_activities', username: 'User')
end
-
- describe 'redirect alias routes' do
- include RSpec::Rails::RequestExampleGroup
-
- it '/u/user1 redirects to /user1' do
- expect(get("/u/user1")).to redirect_to('/user1')
- end
-
- it '/u/user1/groups redirects to /user1/groups' do
- expect(get("/u/user1/groups")).to redirect_to('/users/user1/groups')
- end
-
- it '/u/user1/projects redirects to /user1/projects' do
- expect(get("/u/user1/projects")).to redirect_to('/users/user1/projects')
- end
- end
end
# search GET /search(.:format) search#show
diff --git a/spec/support/helpers/jira_service_helper.rb b/spec/support/helpers/jira_service_helper.rb
index f4d5343c4ed..477bbf1c2e0 100644
--- a/spec/support/helpers/jira_service_helper.rb
+++ b/spec/support/helpers/jira_service_helper.rb
@@ -25,7 +25,7 @@ module JiraServiceHelper
\"32x32\":\"http://0.0.0.0:4567/secure/useravatar?size=medium&avatarId=10122\",
\"48x48\":\"http://0.0.0.0:4567/secure/useravatar?avatarId=10122\"},
\"displayName\":\"GitLab\",\"active\":true},
- \"body\":\"[Administrator|http://localhost:3000/u/root] mentioned JIRA-1 in Merge request of [gitlab-org/gitlab-test|http://localhost:3000/gitlab-org/gitlab-test/merge_requests/2].\",
+ \"body\":\"[Administrator|http://localhost:3000/root] mentioned JIRA-1 in Merge request of [gitlab-org/gitlab-test|http://localhost:3000/gitlab-org/gitlab-test/merge_requests/2].\",
\"updateAuthor\":{\"self\":\"http://0.0.0.0:4567/rest/api/2/user?username=gitlab\",\"name\":\"gitlab\",\"emailAddress\":\"gitlab@example.com\",
\"avatarUrls\":{\"16x16\":\"http://0.0.0.0:4567/secure/useravatar?size=xsmall&avatarId=10122\",
\"24x24\":\"http://0.0.0.0:4567/secure/useravatar?size=small&avatarId=10122\",
@@ -40,7 +40,7 @@ module JiraServiceHelper
\"24x24\":\"http://0.0.0.0:4567/secure/useravatar?size=small&avatarId=10122\",
\"32x32\":\"http://0.0.0.0:4567/secure/useravatar?size=medium&avatarId=10122\",
\"48x48\":\"http://0.0.0.0:4567/secure/useravatar?avatarId=10122\"},\"displayName\":\"GitLab\",\"active\":true},
- \"body\":\"[Administrator|http://localhost:3000/u/root] mentioned this issue in [a commit of h5bp/html5-boilerplate|http://localhost:3000/h5bp/html5-boilerplate/commit/2439f77897122fbeee3bfd9bb692d3608848433e].\",
+ \"body\":\"[Administrator|http://localhost:3000/root] mentioned this issue in [a commit of h5bp/html5-boilerplate|http://localhost:3000/h5bp/html5-boilerplate/commit/2439f77897122fbeee3bfd9bb692d3608848433e].\",
\"updateAuthor\":{\"self\":\"http://0.0.0.0:4567/rest/api/2/user?username=gitlab\",\"name\":\"gitlab\",\"emailAddress\":\"gitlab@example.com\",
\"avatarUrls\":{\"16x16\":\"http://0.0.0.0:4567/secure/useravatar?size=xsmall&avatarId=10122\",
\"24x24\":\"http://0.0.0.0:4567/secure/useravatar?size=small&avatarId=10122\",