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
58d66f28
Commit
58d66f28
authored
Oct 16, 2021
by
Guillaume CHAUVEL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pipeline artifacts and uploads sizes to project REST API
Changelog: other
parent
bfb41887
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
8 deletions
+30
-8
doc/api/projects.md
doc/api/projects.md
+23
-5
lib/api/entities/project_statistics.rb
lib/api/entities/project_statistics.rb
+3
-1
spec/models/project_statistics_spec.rb
spec/models/project_statistics_spec.rb
+3
-1
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+1
-1
No files found.
doc/api/projects.md
View file @
58d66f28
...
...
@@ -191,8 +191,10 @@ When the user is authenticated and `simple` is not set this returns something li
"wiki_size"
:
0
,
"lfs_objects_size"
:
0
,
"job_artifacts_size"
:
0
,
"pipeline_artifacts_size"
:
0
,
"packages_size"
:
0
,
"snippets_size"
:
0
"snippets_size"
:
0
,
"uploads_size"
:
0
},
"container_registry_image_prefix"
:
"registry.example.com/diaspora/diaspora-client"
,
"_links"
:
{
...
...
@@ -303,8 +305,10 @@ When the user is authenticated and `simple` is not set this returns something li
"wiki_size"
:
0
,
"lfs_objects_size"
:
0
,
"job_artifacts_size"
:
0
,
"pipeline_artifacts_size"
:
0
,
"packages_size"
:
0
,
"snippets_size"
:
0
"snippets_size"
:
0
,
"uploads_size"
:
0
},
"container_registry_image_prefix"
:
"registry.example.com/brightbox/puppet"
,
"_links"
:
{
...
...
@@ -469,8 +473,10 @@ GET /users/:user_id/projects
"wiki_size"
:
0
,
"lfs_objects_size"
:
0
,
"job_artifacts_size"
:
0
,
"pipeline_artifacts_size"
:
0
,
"packages_size"
:
0
,
"snippets_size"
:
0
"snippets_size"
:
0
,
"uploads_size"
:
0
},
"container_registry_image_prefix"
:
"registry.example.com/diaspora/diaspora-client"
,
"_links"
:
{
...
...
@@ -581,8 +587,10 @@ GET /users/:user_id/projects
"wiki_size"
:
0
,
"lfs_objects_size"
:
0
,
"job_artifacts_size"
:
0
,
"pipeline_artifacts_size"
:
0
,
"packages_size"
:
0
,
"snippets_size"
:
0
"snippets_size"
:
0
,
"uploads_size"
:
0
},
"container_registry_image_prefix"
:
"registry.example.com/brightbox/puppet"
,
"_links"
:
{
...
...
@@ -704,6 +712,10 @@ Example response:
"repository_size"
:
1038090
,
"lfs_objects_size"
:
0
,
"job_artifacts_size"
:
0
"pipeline_artifacts_size"
:
0
,
"packages_size"
:
0
,
"snippets_size"
:
0
,
"uploads_size"
:
0
},
"container_registry_image_prefix"
:
"registry.example.com/diaspora/diaspora-client"
,
"_links"
:
{
...
...
@@ -811,6 +823,10 @@ Example response:
"repository_size"
:
2066080
,
"lfs_objects_size"
:
0
,
"job_artifacts_size"
:
0
"pipeline_artifacts_size"
:
0
,
"packages_size"
:
0
,
"snippets_size"
:
0
,
"uploads_size"
:
0
},
"container_registry_image_prefix"
:
"registry.example.com/brightbox/puppet"
,
"_links"
:
{
...
...
@@ -978,8 +994,10 @@ GET /projects/:id
"wiki_size"
:
0
,
"lfs_objects_size"
:
0
,
"job_artifacts_size"
:
0
,
"pipeline_artifacts_size"
:
0
,
"packages_size"
:
0
,
"snippets_size"
:
0
"snippets_size"
:
0
,
"uploads_size"
:
0
},
"container_registry_image_prefix"
:
"registry.example.com/diaspora/diaspora-client"
,
"_links"
:
{
...
...
lib/api/entities/project_statistics.rb
View file @
58d66f28
...
...
@@ -9,8 +9,10 @@ module API
expose
:wiki_size
expose
:lfs_objects_size
expose
:build_artifacts_size
,
as: :job_artifacts_size
expose
:
snippe
ts_size
expose
:
pipeline_artifac
ts_size
expose
:packages_size
expose
:snippets_size
expose
:uploads_size
end
end
end
spec/models/project_statistics_spec.rb
View file @
58d66f28
...
...
@@ -325,12 +325,14 @@ RSpec.describe ProjectStatistics do
lfs_objects_size:
3
,
snippets_size:
2
,
pipeline_artifacts_size:
3
,
build_artifacts_size:
3
,
packages_size:
6
,
uploads_size:
5
)
statistics
.
reload
expect
(
statistics
.
storage_size
).
to
eq
19
expect
(
statistics
.
storage_size
).
to
eq
28
end
it
'works during wiki_size backfill'
do
...
...
spec/requests/api/projects_spec.rb
View file @
58d66f28
...
...
@@ -358,7 +358,7 @@ RSpec.describe API::Projects do
statistics
=
json_response
.
find
{
|
p
|
p
[
'id'
]
==
project
.
id
}[
'statistics'
]
expect
(
statistics
).
to
be_present
expect
(
statistics
).
to
include
(
'commit_count'
,
'storage_size'
,
'repository_size'
,
'wiki_size'
,
'lfs_objects_size'
,
'job_artifacts_size'
,
'
snippets_size'
,
'package
s_size'
)
expect
(
statistics
).
to
include
(
'commit_count'
,
'storage_size'
,
'repository_size'
,
'wiki_size'
,
'lfs_objects_size'
,
'job_artifacts_size'
,
'
pipeline_artifacts_size'
,
'snippets_size'
,
'packages_size'
,
'upload
s_size'
)
end
it
"does not include license by default"
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