Commit 99f1280a authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '208256-remove-deprecated-design-management-routes' into 'master'

Remove deprecated design route

See merge request gitlab-org/gitlab!30917
parents a1b737af 25c90127
---
title: Remove deprecated route for serving full-size Design Management design files
merge_request: 30917
author:
type: removed
......@@ -43,20 +43,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
# DEPRECATED: Remove this redirection in GitLab 13.0.
# This redirection supports old (pre-12.9) routes to Design Management raw images.
# https://gitlab.com/gitlab-org/gitlab/issues/208256
get '/designs/:id(/*ref)',
as: :design,
contraints: { id: /\d+/, ref: Gitlab::PathRegex.git_reference_regex },
to: redirect { |params|
namespace_id, project_id, id, ref = params.values_at(:namespace_id, :project_id, :id, :ref)
# The :ref route segment is optional in both this route, and the route
# we redirect to (where it is called :sha).
ref_path = "/#{ref}" if ref
"#{namespace_id}/#{project_id}/-/design_management/designs/#{id}#{ref_path}/raw_image"
}
namespace :design_management do
namespace :designs, path: 'designs/:design_id(/:sha)', constraints: -> (params) { params[:sha].nil? || Gitlab::Git.commit_id?(params[:sha]) } do
resource :raw_image, only: :show
......
......@@ -16,7 +16,7 @@ describe 'Users views raw design image files' do
end
it 'serves the latest design version when no ref is given' do
visit project_design_path(design.project, design)
visit project_design_management_designs_raw_image_path(design.project, design)
expect(response_headers[Gitlab::Workhorse::SEND_DATA_HEADER]).to eq(
workhorse_data_header_for_version(oldest_version.sha)
......@@ -24,7 +24,7 @@ describe 'Users views raw design image files' do
end
it 'serves the correct design version when a ref is given' do
visit project_design_path(design.project, design, oldest_version.sha)
visit project_design_management_designs_raw_image_path(design.project, design, oldest_version.sha)
expect(response_headers[Gitlab::Workhorse::SEND_DATA_HEADER]).to eq(
workhorse_data_header_for_version(oldest_version.sha)
......
......@@ -57,15 +57,6 @@ describe 'EE-specific project routing' do
end
end
describe 'Deprecated Design management legacy paths' do
include RSpec::Rails::RequestExampleGroup
it 'redirects to canonical path' do
expect(get('/gitlab/gitlabhq/-/designs/1/c6f00aa50b80887ada30a6fe517670be9f8f9ece')).to redirect_to('/gitlab/gitlabhq/-/design_management/designs/1/c6f00aa50b80887ada30a6fe517670be9f8f9ece/raw_image')
expect(get('/gitlab/gitlabhq/-/designs/1')).to redirect_to('/gitlab/gitlabhq/-/design_management/designs/1/raw_image')
end
end
describe Projects::AutocompleteSourcesController, 'routing' do
it "to #epics" do
expect(get("/gitlab/gitlabhq/-/autocomplete_sources/epics")).to route_to("projects/autocomplete_sources#epics", namespace_id: 'gitlab', project_id: 'gitlabhq')
......
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