Commit e643f47b authored by Tyler Amos's avatar Tyler Amos

Conditional excess storage data in api response

- Include excess storage data in getStorageCounter GraphQL response
based on optional parameter withExcessStorageData.
- Use updated field name repositorySizeExcessProjectCount in query.
- Include actual_size_limit for the project in the GraphQL response.
parent 17ddb7f7
......@@ -12917,6 +12917,11 @@ enum PipelineStatusEnum {
}
type Project {
"""
Size limit for the repository in bytes
"""
actualSizeLimit: Float
"""
A single Alert Management alert of the project
"""
......
......@@ -38144,6 +38144,20 @@
"name": "Project",
"description": null,
"fields": [
{
"name": "actualSizeLimit",
"description": "Size limit for the repository in bytes",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Float",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "alertManagementAlert",
"description": "A single Alert Management alert of the project",
......@@ -1882,6 +1882,7 @@ Autogenerated return type of PipelineRetry.
| Field | Type | Description |
| ----- | ---- | ----------- |
| `actualSizeLimit` | Float | Size limit for the repository in bytes |
| `alertManagementAlert` | AlertManagementAlert | A single Alert Management alert of the project |
| `alertManagementAlertStatusCounts` | AlertManagementAlertStatusCountsType | Counts of alerts by status for the project |
| `allowMergeOnSkippedPipeline` | Boolean | If `only_allow_merge_if_pipeline_succeeds` is true, indicates if merge requests of the project can also be merged with skipped jobs |
......
query getStorageCounter($fullPath: ID!) {
query getStorageCounter($fullPath: ID!, $withExcessStorageData: Boolean = false) {
namespace(fullPath: $fullPath) {
id
storageSizeLimit
additionalPurchasedStorageSize
totalRepositorySizeExcess
totalRepositorySize
containsLockedProjects
lockedProjectCount
additionalPurchasedStorageSize @include(if: $withExcessStorageData)
totalRepositorySizeExcess @include(if: $withExcessStorageData)
totalRepositorySize @include(if: $withExcessStorageData)
containsLockedProjects @include(if: $withExcessStorageData)
repositorySizeExcessProjectCount @include(if: $withExcessStorageData)
rootStorageStatistics {
storageSize
repositorySize
......@@ -25,7 +25,8 @@ query getStorageCounter($fullPath: ID!) {
avatarUrl
webUrl
name
repositorySizeExcess
repositorySizeExcess @include(if: $withExcessStorageData)
actualSizeLimit @include(if: $withExcessStorageData)
statistics {
commitCount
storageSize
......
......@@ -120,6 +120,11 @@ module EE
null: true,
description: 'Size of repository that exceeds the limit in bytes'
field :actual_size_limit,
GraphQL::FLOAT_TYPE,
null: true,
description: 'Size limit for the repository in bytes'
def self.sast_ci_configuration(project)
::Security::CiConfiguration::SastParserService.new(project).configuration
end
......
......@@ -17,7 +17,7 @@ RSpec.describe GitlabSchema.types['Project'] do
expected_fields = %w[
vulnerabilities sast_ci_configuration vulnerability_scanners requirement_states_count
vulnerability_severities_count packages compliance_frameworks vulnerabilities_count_by_day
security_dashboard_path iterations cluster_agents repository_size_excess
security_dashboard_path iterations cluster_agents repository_size_excess actual_size_limit
]
expect(described_class).to include_graphql_fields(*expected_fields)
......
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