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
ae7f16d8
Commit
ae7f16d8
authored
Jun 27, 2019
by
Patrick Bajao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pagination for GET /project_aliases
Includes changes to use stub_licensed_features
parent
99fba09e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
4 deletions
+10
-4
ee/lib/api/project_aliases.rb
ee/lib/api/project_aliases.rb
+6
-1
ee/spec/lib/ee/gitlab/repo_path_spec.rb
ee/spec/lib/ee/gitlab/repo_path_spec.rb
+1
-1
ee/spec/requests/api/internal_spec.rb
ee/spec/requests/api/internal_spec.rb
+1
-1
ee/spec/requests/api/project_aliases_spec.rb
ee/spec/requests/api/project_aliases_spec.rb
+2
-1
No files found.
ee/lib/api/project_aliases.rb
View file @
ae7f16d8
...
...
@@ -2,6 +2,8 @@
module
API
class
ProjectAliases
<
Grape
::
API
include
PaginationParams
before
{
check_feature_availability
}
before
{
authenticated_as_admin!
}
...
...
@@ -23,8 +25,11 @@ module API
desc
'Get a list of all project aliases'
do
success
EE
::
API
::
Entities
::
ProjectAlias
end
params
do
use
:pagination
end
get
do
present
ProjectAlias
.
all
,
with:
EE
::
API
::
Entities
::
ProjectAlias
present
paginate
(
ProjectAlias
.
all
)
,
with:
EE
::
API
::
Entities
::
ProjectAlias
end
desc
'Get info of specific project alias by name'
do
...
...
ee/spec/lib/ee/gitlab/repo_path_spec.rb
View file @
ae7f16d8
...
...
@@ -18,7 +18,7 @@ describe Gitlab::RepoPath do
context
'with premium license'
do
before
do
create
(
:license
,
plan:
License
::
PREMIUM_PLAN
)
stub_licensed_features
(
project_aliases:
true
)
end
context
'project_path matches a project alias'
do
...
...
ee/spec/requests/api/internal_spec.rb
View file @
ae7f16d8
...
...
@@ -56,7 +56,7 @@ describe API::Internal do
context
"with premium license"
do
before
do
create
(
:license
,
plan:
License
::
PREMIUM_PLAN
)
stub_licensed_features
(
project_aliases:
true
)
end
context
"project matches a project alias"
do
...
...
ee/spec/requests/api/project_aliases_spec.rb
View file @
ae7f16d8
...
...
@@ -72,7 +72,7 @@ describe API::ProjectAliases, api: true do
end
before
do
create
(
:license
,
plan:
License
::
PREMIUM_PLAN
)
stub_licensed_features
(
project_aliases:
true
)
end
describe
'GET /project_aliases'
do
...
...
@@ -90,6 +90,7 @@ describe API::ProjectAliases, api: true do
it
'returns the project aliases list'
do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
match_response_schema
(
'public_api/v4/project_aliases'
,
dir:
'ee'
)
expect
(
response
).
to
include_pagination_headers
end
end
end
...
...
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