From 03c303d7961f42f9a046936a9a9bc4f9ce2ec2b9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 13 May 2020 18:25:05 +0300 Subject: [PATCH] Add redirect for project tags page Signed-off-by: Dmitriy Zaporozhets --- config/routes/project.rb | 2 +- spec/routing/project_routing_spec.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/routes/project.rb b/config/routes/project.rb index 0cd880a8c46a18..e5211cc629ee96 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -482,7 +482,7 @@ # Legacy routes. # Introduced in 12.0. # Should be removed with https://gitlab.com/gitlab-org/gitlab/issues/28848. - Gitlab::Routing.redirect_legacy_paths(self, :mirror, + Gitlab::Routing.redirect_legacy_paths(self, :mirror, :tags, :cycle_analytics, :mattermost, :variables, :triggers, :environments, :protected_environments, :error_tracking, :alert_management, :serverless, :clusters, :audit_events, :wikis, :merge_requests, diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb index 4fe612c1d0e0a2..8c73d7bbca338a 100644 --- a/spec/routing/project_routing_spec.rb +++ b/spec/routing/project_routing_spec.rb @@ -230,6 +230,8 @@ expect(delete('/gitlab/gitlabhq/-/tags/feature%2B45/foo/bar/baz')).to route_to('projects/tags#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature+45/foo/bar/baz') expect(delete('/gitlab/gitlabhq/-/tags/feature@45/foo/bar/baz')).to route_to('projects/tags#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature@45/foo/bar/baz') end + + it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/tags", "/gitlab/gitlabhq/-/tags" end # project_deploy_keys GET /:project_id/deploy_keys(.:format) deploy_keys#index -- GitLab