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
fde01829
Commit
fde01829
authored
Dec 19, 2019
by
Giorgenes Gelatti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds project_id and project_path to group api
Adds fields to group package api
parent
85cad651
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
55 additions
and
3 deletions
+55
-3
ee/changelogs/unreleased/35527-add-group-package-api-fields.yml
...ngelogs/unreleased/35527-add-group-package-api-fields.yml
+5
-0
ee/lib/api/group_packages.rb
ee/lib/api/group_packages.rb
+1
-1
ee/lib/ee/api/entities.rb
ee/lib/ee/api/entities.rb
+8
-0
ee/spec/fixtures/api/schemas/public_api/v4/packages/group_package.json
...res/api/schemas/public_api/v4/packages/group_package.json
+33
-0
ee/spec/fixtures/api/schemas/public_api/v4/packages/group_packages.json
...es/api/schemas/public_api/v4/packages/group_packages.json
+4
-0
ee/spec/requests/api/group_packages_spec.rb
ee/spec/requests/api/group_packages_spec.rb
+1
-0
ee/spec/requests/api/project_packages_spec.rb
ee/spec/requests/api/project_packages_spec.rb
+1
-0
ee/spec/support/shared_examples/packages_shared_examples.rb
ee/spec/support/shared_examples/packages_shared_examples.rb
+2
-2
No files found.
ee/changelogs/unreleased/35527-add-group-package-api-fields.yml
0 → 100644
View file @
fde01829
---
title
:
Adds project_id and project_path to package group api
merge_request
:
22089
author
:
type
:
added
ee/lib/api/group_packages.rb
View file @
fde01829
...
...
@@ -29,7 +29,7 @@ module API
exclude_subgroups:
params
[
:exclude_subgroups
]
).
execute
present
paginate
(
packages
),
with:
EE
::
API
::
Entities
::
Package
present
paginate
(
packages
),
with:
EE
::
API
::
Entities
::
Package
,
user:
current_user
,
group:
true
end
end
end
...
...
ee/lib/ee/api/entities.rb
View file @
fde01829
...
...
@@ -885,6 +885,14 @@ module EE
end
expose
:created_at
expose
:project_id
,
if:
->
(
_
,
opts
)
{
opts
[
:group
]
}
expose
:project_path
,
if:
->
(
_
,
opts
)
{
opts
[
:group
]
}
private
def
project_path
object
.
project
.
root_namespace
.
path
end
end
class
PackageFile
<
Grape
::
Entity
...
...
ee/spec/fixtures/api/schemas/public_api/v4/packages/group_package.json
0 → 100644
View file @
fde01829
{
"type"
:
"object"
,
"required"
:
[
"name"
,
"version"
,
"package_type"
,
"_links"
,
"project_id"
,
"project_path"
],
"properties"
:
{
"name"
:
{
"type"
:
"string"
},
"version"
:
{
"type"
:
"string"
},
"package_type"
:
{
"type"
:
"string"
},
"_links"
:
{
"type"
:
"object"
,
"required"
:
[
"web_path"
],
"properties"
:
{
"details"
:
{
"type"
:
"string"
}
}
},
"created_at"
:
{
"type"
:
"string"
},
"project_id"
:
{
"type"
:
"integer"
},
"project_path"
:
{
"type"
:
"string"
}
}
}
ee/spec/fixtures/api/schemas/public_api/v4/packages/group_packages.json
0 → 100644
View file @
fde01829
{
"type"
:
"array"
,
"items"
:
{
"$ref"
:
"./group_package.json"
}
}
ee/spec/requests/api/group_packages_spec.rb
View file @
fde01829
...
...
@@ -13,6 +13,7 @@ describe API::GroupPackages do
describe
'GET /groups/:id/packages'
do
let
(
:url
)
{
"/groups/
#{
group
.
id
}
/packages"
}
let
(
:package_schema
)
{
'public_api/v4/packages/group_packages'
}
context
'with packages feature enabled'
do
before
do
...
...
ee/spec/requests/api/project_packages_spec.rb
View file @
fde01829
...
...
@@ -14,6 +14,7 @@ describe API::ProjectPackages do
describe
'GET /projects/:id/packages'
do
let
(
:url
)
{
"/projects/
#{
project
.
id
}
/packages"
}
let
(
:package_schema
)
{
'public_api/v4/packages/packages'
}
subject
{
get
api
(
url
)
}
...
...
ee/spec/support/shared_examples/packages_shared_examples.rb
View file @
fde01829
...
...
@@ -27,7 +27,7 @@ shared_examples 'returns packages' do |container_type, user_type|
it
'returns a valid response schema'
do
subject
expect
(
response
).
to
match_response_schema
(
'public_api/v4/packages/packages'
,
dir:
'ee'
)
expect
(
response
).
to
match_response_schema
(
package_schema
,
dir:
'ee'
)
end
it
'returns two packages'
do
...
...
@@ -54,7 +54,7 @@ shared_examples 'returns packages with subgroups' do |container_type, user_type|
it
'returns a valid response schema'
do
subject
expect
(
response
).
to
match_response_schema
(
'public_api/v4/packages/packages'
,
dir:
'ee'
)
expect
(
response
).
to
match_response_schema
(
package_schema
,
dir:
'ee'
)
end
it
'returns three packages'
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