Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
89bf5073
Commit
89bf5073
authored
Mar 30, 2021
by
Dmytro Zaporozhets (DZ)
Committed by
Rémy Coutable
Mar 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated repo archive routes
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
e10f7ccd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
51 deletions
+6
-51
changelogs/unreleased/232811-remove-deprecated-repo-archive-routes.yml
...released/232811-remove-deprecated-repo-archive-routes.yml
+5
-0
config/routes/repository.rb
config/routes/repository.rb
+1
-9
spec/controllers/projects/repositories_controller_spec.rb
spec/controllers/projects/repositories_controller_spec.rb
+0
-22
spec/routing/project_routing_spec.rb
spec/routing/project_routing_spec.rb
+0
-20
No files found.
changelogs/unreleased/232811-remove-deprecated-repo-archive-routes.yml
0 → 100644
View file @
89bf5073
---
title
:
Remove deprecated repository archive routes
merge_request
:
57236
author
:
type
:
removed
config/routes/repository.rb
View file @
89bf5073
...
...
@@ -2,15 +2,7 @@
# All routing related to repository browsing
resource
:repository
,
only:
[
:create
]
do
member
do
# deprecated since GitLab 9.5
get
'archive'
,
constraints:
{
format:
Gitlab
::
PathRegex
.
archive_formats_regex
},
as:
'archive_alternative'
,
defaults:
{
append_sha:
true
}
# deprecated since GitLab 10.7
get
':id/archive'
,
constraints:
{
format:
Gitlab
::
PathRegex
.
archive_formats_regex
,
id:
/.+/
},
action:
'archive'
,
as:
'archive_deprecated'
,
defaults:
{
append_sha:
true
}
end
end
resource
:repository
,
only:
[
:create
]
resources
:commit
,
only:
[
:show
],
constraints:
{
id:
/\h{7,40}/
}
do
member
do
...
...
spec/controllers/projects/repositories_controller_spec.rb
View file @
89bf5073
...
...
@@ -56,28 +56,6 @@ RSpec.describe Projects::RepositoriesController do
expect
(
response
.
header
[
Gitlab
::
Workhorse
::
SEND_DATA_HEADER
]).
to
start_with
(
"git-archive:"
)
end
it
'handles legacy queries with no ref'
do
get
:archive
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
},
format:
"zip"
expect
(
response
.
header
[
Gitlab
::
Workhorse
::
SEND_DATA_HEADER
]).
to
start_with
(
"git-archive:"
)
end
it
'handles legacy queries with the ref specified as ref in params'
do
get
:archive
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
ref:
'feature'
},
format:
'zip'
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
assigns
(
:ref
)).
to
eq
(
'feature'
)
expect
(
response
.
header
[
Gitlab
::
Workhorse
::
SEND_DATA_HEADER
]).
to
start_with
(
"git-archive:"
)
end
it
'handles legacy queries with the ref specified as id in params'
do
get
:archive
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
'feature'
},
format:
'zip'
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
assigns
(
:ref
)).
to
eq
(
'feature'
)
expect
(
response
.
header
[
Gitlab
::
Workhorse
::
SEND_DATA_HEADER
]).
to
start_with
(
"git-archive:"
)
end
it
'prioritizes the id param over the ref param when both are specified'
do
get
:archive
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
'feature'
,
ref:
'feature_conflict'
},
format:
'zip'
...
...
spec/routing/project_routing_spec.rb
View file @
89bf5073
...
...
@@ -126,26 +126,6 @@ RSpec.describe 'project routing' do
it
'to #archive with "/" in route'
do
expect
(
get
(
'/gitlab/gitlabhq/-/archive/improve/awesome/gitlabhq-improve-awesome.tar.gz'
)).
to
route_to
(
'projects/repositories#archive'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
format:
'tar.gz'
,
id:
'improve/awesome/gitlabhq-improve-awesome'
)
end
it
'to #archive_alternative'
do
expect
(
get
(
'/gitlab/gitlabhq/-/repository/archive'
)).
to
route_to
(
'projects/repositories#archive'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
append_sha:
true
)
end
it
'to #archive_deprecated'
do
expect
(
get
(
'/gitlab/gitlabhq/-/repository/master/archive'
)).
to
route_to
(
'projects/repositories#archive'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'master'
,
append_sha:
true
)
end
it
'to #archive_deprecated format:zip'
do
expect
(
get
(
'/gitlab/gitlabhq/-/repository/master/archive.zip'
)).
to
route_to
(
'projects/repositories#archive'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
format:
'zip'
,
id:
'master'
,
append_sha:
true
)
end
it
'to #archive_deprecated format:tar.bz2'
do
expect
(
get
(
'/gitlab/gitlabhq/-/repository/master/archive.tar.bz2'
)).
to
route_to
(
'projects/repositories#archive'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
format:
'tar.bz2'
,
id:
'master'
,
append_sha:
true
)
end
it
'to #archive_deprecated with "/" in route'
do
expect
(
get
(
'/gitlab/gitlabhq/-/repository/improve/awesome/archive'
)).
to
route_to
(
'projects/repositories#archive'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'improve/awesome'
,
append_sha:
true
)
end
end
describe
Projects
::
BranchesController
,
'routing'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment