Expose snippets_size in ProjectStatistics Entity

This commit add the snippets_size field to
the ProjectStatistics Entity.
parent 67a0b331
---
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
"wiki_size" : 0,
"lfs_objects_size": 0,
"job_artifacts_size": 0,
"packages_size": 0
"packages_size": 0,
"snippets_size": 0
},
"_links": {
"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
"wiki_size" : 0,
"lfs_objects_size": 0,
"job_artifacts_size": 0,
"packages_size": 0
"packages_size": 0,
"snippets_size": 0
},
"_links": {
"self": "http://example.com/api/v4/projects",
......@@ -426,7 +428,8 @@ This endpoint supports [keyset pagination](README.md#keyset-based-pagination) fo
"wiki_size" : 0,
"lfs_objects_size": 0,
"job_artifacts_size": 0,
"packages_size": 0
"packages_size": 0,
"snippets_size": 0
},
"_links": {
"self": "http://example.com/api/v4/projects",
......@@ -528,7 +531,8 @@ This endpoint supports [keyset pagination](README.md#keyset-based-pagination) fo
"wiki_size" : 0,
"lfs_objects_size": 0,
"job_artifacts_size": 0,
"packages_size": 0
"packages_size": 0,
"snippets_size": 0
},
"_links": {
"self": "http://example.com/api/v4/projects",
......@@ -899,7 +903,8 @@ GET /projects/:id
"wiki_size" : 0,
"lfs_objects_size": 0,
"job_artifacts_size": 0,
"packages_size": 0
"packages_size": 0,
"snippets_size": 0
},
"_links": {
"self": "http://example.com/api/v4/projects",
......
......@@ -9,6 +9,7 @@ module API
expose :wiki_size
expose :lfs_objects_size
expose :build_artifacts_size, as: :job_artifacts_size
expose :snippets_size
end
end
end
......@@ -254,7 +254,10 @@ RSpec.describe API::Projects do
expect(response).to have_gitlab_http_status(:ok)
expect(response).to include_pagination_headers
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
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