Commit f736c78a authored by Markus Koller's avatar Markus Koller

Merge branch 'fj-223705-add-snippets-size-to-project-statistics-entity' into 'master'

Expose snippets_size in ProjectStatistics Entity

See merge request gitlab-org/gitlab!35316
parents 3a6952c2 86be5ba3
---
title: Expose snippets_size in ProjectStatistics Entity
merge_request: 35316
author:
type: changed
...@@ -175,7 +175,8 @@ When the user is authenticated and `simple` is not set this returns something li ...@@ -175,7 +175,8 @@ When the user is authenticated and `simple` is not set this returns something li
"wiki_size" : 0, "wiki_size" : 0,
"lfs_objects_size": 0, "lfs_objects_size": 0,
"job_artifacts_size": 0, "job_artifacts_size": 0,
"packages_size": 0 "packages_size": 0,
"snippets_size": 0
}, },
"_links": { "_links": {
"self": "http://example.com/api/v4/projects", "self": "http://example.com/api/v4/projects",
...@@ -277,7 +278,8 @@ When the user is authenticated and `simple` is not set this returns something li ...@@ -277,7 +278,8 @@ When the user is authenticated and `simple` is not set this returns something li
"wiki_size" : 0, "wiki_size" : 0,
"lfs_objects_size": 0, "lfs_objects_size": 0,
"job_artifacts_size": 0, "job_artifacts_size": 0,
"packages_size": 0 "packages_size": 0,
"snippets_size": 0
}, },
"_links": { "_links": {
"self": "http://example.com/api/v4/projects", "self": "http://example.com/api/v4/projects",
...@@ -426,7 +428,8 @@ This endpoint supports [keyset pagination](README.md#keyset-based-pagination) fo ...@@ -426,7 +428,8 @@ This endpoint supports [keyset pagination](README.md#keyset-based-pagination) fo
"wiki_size" : 0, "wiki_size" : 0,
"lfs_objects_size": 0, "lfs_objects_size": 0,
"job_artifacts_size": 0, "job_artifacts_size": 0,
"packages_size": 0 "packages_size": 0,
"snippets_size": 0
}, },
"_links": { "_links": {
"self": "http://example.com/api/v4/projects", "self": "http://example.com/api/v4/projects",
...@@ -528,7 +531,8 @@ This endpoint supports [keyset pagination](README.md#keyset-based-pagination) fo ...@@ -528,7 +531,8 @@ This endpoint supports [keyset pagination](README.md#keyset-based-pagination) fo
"wiki_size" : 0, "wiki_size" : 0,
"lfs_objects_size": 0, "lfs_objects_size": 0,
"job_artifacts_size": 0, "job_artifacts_size": 0,
"packages_size": 0 "packages_size": 0,
"snippets_size": 0
}, },
"_links": { "_links": {
"self": "http://example.com/api/v4/projects", "self": "http://example.com/api/v4/projects",
...@@ -899,7 +903,8 @@ GET /projects/:id ...@@ -899,7 +903,8 @@ GET /projects/:id
"wiki_size" : 0, "wiki_size" : 0,
"lfs_objects_size": 0, "lfs_objects_size": 0,
"job_artifacts_size": 0, "job_artifacts_size": 0,
"packages_size": 0 "packages_size": 0,
"snippets_size": 0
}, },
"_links": { "_links": {
"self": "http://example.com/api/v4/projects", "self": "http://example.com/api/v4/projects",
......
...@@ -9,6 +9,7 @@ module API ...@@ -9,6 +9,7 @@ module API
expose :wiki_size expose :wiki_size
expose :lfs_objects_size expose :lfs_objects_size
expose :build_artifacts_size, as: :job_artifacts_size expose :build_artifacts_size, as: :job_artifacts_size
expose :snippets_size
end end
end end
end end
...@@ -254,7 +254,10 @@ RSpec.describe API::Projects do ...@@ -254,7 +254,10 @@ RSpec.describe API::Projects do
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(response).to include_pagination_headers expect(response).to include_pagination_headers
expect(json_response).to be_an Array expect(json_response).to be_an Array
expect(json_response.first).to include 'statistics'
statistics = json_response.first['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')
end end
it "does not include license by default" do it "does not include license by default" do
......
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