Commit fe0833dc authored by Sean McGivern's avatar Sean McGivern

Merge branch '255348-excess-storage-info-in-storage-graphql-part-2' into 'master'

Include excess storage data in the storage endpoint response

See merge request gitlab-org/gitlab!43837
parents 3c0010fd f2dcdf2f
......@@ -7260,6 +7260,16 @@ type GrafanaIntegration {
}
type Group {
"""
Size limit for repositories in the namespace in bytes
"""
actualRepositorySizeLimit: Float
"""
Additional storage purchased for the root namespace in bytes
"""
additionalPurchasedStorageSize: Float
"""
Indicates whether Auto DevOps is enabled for all projects within this group
"""
......@@ -7310,6 +7320,11 @@ type Group {
last: Int
): BoardConnection
"""
Includes at least one project where the repository size exceeds the limit
"""
containsLockedProjects: Boolean!
"""
Description of the namespace
"""
......@@ -7968,6 +7983,11 @@ type Group {
sort: NamespaceProjectSort = null
): ProjectConnection!
"""
Number of projects in the root namespace where the repository size exceeds the limit
"""
repositorySizeExcessProjectCount: Int!
"""
Indicates if users can request access to namespace
"""
......@@ -8048,6 +8068,16 @@ type Group {
startTime: Time
): TimelogConnection!
"""
Total repository size of all projects in the root namespace in bytes
"""
totalRepositorySize: Float
"""
Total excess repository size of all projects in the root namespace in bytes
"""
totalRepositorySizeExcess: Float
"""
Time before two-factor authentication is enforced
"""
......@@ -11954,6 +11984,21 @@ enum MutationOperationMode {
}
type Namespace {
"""
Size limit for repositories in the namespace in bytes
"""
actualRepositorySizeLimit: Float
"""
Additional storage purchased for the root namespace in bytes
"""
additionalPurchasedStorageSize: Float
"""
Includes at least one project where the repository size exceeds the limit
"""
containsLockedProjects: Boolean!
"""
Description of the namespace
"""
......@@ -12044,6 +12089,11 @@ type Namespace {
sort: NamespaceProjectSort = null
): ProjectConnection!
"""
Number of projects in the root namespace where the repository size exceeds the limit
"""
repositorySizeExcessProjectCount: Int!
"""
Indicates if users can request access to namespace
"""
......@@ -12064,6 +12114,16 @@ type Namespace {
"""
temporaryStorageIncreaseEndsOn: Time
"""
Total repository size of all projects in the root namespace in bytes
"""
totalRepositorySize: Float
"""
Total excess repository size of all projects in the root namespace in bytes
"""
totalRepositorySizeExcess: Float
"""
Visibility of the namespace
"""
......@@ -12933,6 +12993,11 @@ enum PipelineStatusEnum {
}
type Project {
"""
Size limit for the repository in bytes
"""
actualRepositorySizeLimit: Float
"""
A single Alert Management alert of the project
"""
......@@ -14121,6 +14186,11 @@ type Project {
"""
repository: Repository
"""
Size of repository that exceeds the limit in bytes
"""
repositorySizeExcess: Float
"""
Indicates if users can request member access to the project
"""
......
......@@ -20072,6 +20072,34 @@
"name": "Group",
"description": null,
"fields": [
{
"name": "actualRepositorySizeLimit",
"description": "Size limit for repositories in the namespace in bytes",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Float",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "additionalPurchasedStorageSize",
"description": "Additional storage purchased for the root namespace in bytes",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Float",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "autoDevopsEnabled",
"description": "Indicates whether Auto DevOps is enabled for all projects within this group",
......@@ -20190,6 +20218,24 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "containsLockedProjects",
"description": "Includes at least one project where the repository size exceeds the limit",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "description",
"description": "Description of the namespace",
......@@ -21720,6 +21766,24 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "repositorySizeExcessProjectCount",
"description": "Number of projects in the root namespace where the repository size exceeds the limit",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "requestAccessEnabled",
"description": "Indicates if users can request access to namespace",
......@@ -21915,6 +21979,34 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "totalRepositorySize",
"description": "Total repository size of all projects in the root namespace in bytes",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Float",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "totalRepositorySizeExcess",
"description": "Total excess repository size of all projects in the root namespace in bytes",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Float",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "twoFactorGracePeriod",
"description": "Time before two-factor authentication is enforced",
......@@ -35215,6 +35307,52 @@
"name": "Namespace",
"description": null,
"fields": [
{
"name": "actualRepositorySizeLimit",
"description": "Size limit for repositories in the namespace in bytes",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Float",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "additionalPurchasedStorageSize",
"description": "Additional storage purchased for the root namespace in bytes",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Float",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "containsLockedProjects",
"description": "Includes at least one project where the repository size exceeds the limit",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "description",
"description": "Description of the namespace",
......@@ -35462,6 +35600,24 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "repositorySizeExcessProjectCount",
"description": "Number of projects in the root namespace where the repository size exceeds the limit",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "requestAccessEnabled",
"description": "Indicates if users can request access to namespace",
......@@ -35518,6 +35674,34 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "totalRepositorySize",
"description": "Total repository size of all projects in the root namespace in bytes",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Float",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "totalRepositorySizeExcess",
"description": "Total excess repository size of all projects in the root namespace in bytes",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Float",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "visibility",
"description": "Visibility of the namespace",
......@@ -38181,6 +38365,20 @@
"name": "Project",
"description": null,
"fields": [
{
"name": "actualRepositorySizeLimit",
"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",
......@@ -40992,6 +41190,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "repositorySizeExcess",
"description": "Size of repository that exceeds the limit in bytes",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Float",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "requestAccessEnabled",
"description": "Indicates if users can request member access to the project",
......@@ -1146,9 +1146,12 @@ Autogenerated return type of EpicTreeReorder.
| Field | Type | Description |
| ----- | ---- | ----------- |
| `actualRepositorySizeLimit` | Float | Size limit for repositories in the namespace in bytes |
| `additionalPurchasedStorageSize` | Float | Additional storage purchased for the root namespace in bytes |
| `autoDevopsEnabled` | Boolean | Indicates whether Auto DevOps is enabled for all projects within this group |
| `avatarUrl` | String | Avatar URL of the group |
| `board` | Board | A single board of the group |
| `containsLockedProjects` | Boolean! | Includes at least one project where the repository size exceeds the limit |
| `description` | String | Description of the namespace |
| `descriptionHtml` | String | The GitLab Flavored Markdown rendering of `description` |
| `emailsDisabled` | Boolean | Indicates if a group has email notifications disabled |
......@@ -1166,6 +1169,7 @@ Autogenerated return type of EpicTreeReorder.
| `parent` | Group | Parent group |
| `path` | String! | Path of the namespace |
| `projectCreationLevel` | String | The permission level required to create projects in the group |
| `repositorySizeExcessProjectCount` | Int! | Number of projects in the root namespace where the repository size exceeds the limit |
| `requestAccessEnabled` | Boolean | Indicates if users can request access to namespace |
| `requireTwoFactorAuthentication` | Boolean | Indicates if all users in this group are required to set up two-factor authentication |
| `rootStorageStatistics` | RootStorageStatistics | Aggregated storage statistics of the namespace. Only available for root namespaces |
......@@ -1173,6 +1177,8 @@ Autogenerated return type of EpicTreeReorder.
| `storageSizeLimit` | Float | Total storage limit of the root namespace in bytes |
| `subgroupCreationLevel` | String | The permission level required to create subgroups within the group |
| `temporaryStorageIncreaseEndsOn` | Time | Date until the temporary storage increase is active |
| `totalRepositorySize` | Float | Total repository size of all projects in the root namespace in bytes |
| `totalRepositorySizeExcess` | Float | Total excess repository size of all projects in the root namespace in bytes |
| `twoFactorGracePeriod` | Int | Time before two-factor authentication is enforced |
| `userPermissions` | GroupPermissions! | Permissions for the current user on the resource |
| `visibility` | String | Visibility of the namespace |
......@@ -1722,6 +1728,9 @@ Contains statistics about a milestone.
| Field | Type | Description |
| ----- | ---- | ----------- |
| `actualRepositorySizeLimit` | Float | Size limit for repositories in the namespace in bytes |
| `additionalPurchasedStorageSize` | Float | Additional storage purchased for the root namespace in bytes |
| `containsLockedProjects` | Boolean! | Includes at least one project where the repository size exceeds the limit |
| `description` | String | Description of the namespace |
| `descriptionHtml` | String | The GitLab Flavored Markdown rendering of `description` |
| `fullName` | String! | Full name of the namespace |
......@@ -1731,10 +1740,13 @@ Contains statistics about a milestone.
| `lfsEnabled` | Boolean | Indicates if Large File Storage (LFS) is enabled for namespace |
| `name` | String! | Name of the namespace |
| `path` | String! | Path of the namespace |
| `repositorySizeExcessProjectCount` | Int! | Number of projects in the root namespace where the repository size exceeds the limit |
| `requestAccessEnabled` | Boolean | Indicates if users can request access to namespace |
| `rootStorageStatistics` | RootStorageStatistics | Aggregated storage statistics of the namespace. Only available for root namespaces |
| `storageSizeLimit` | Float | Total storage limit of the root namespace in bytes |
| `temporaryStorageIncreaseEndsOn` | Time | Date until the temporary storage increase is active |
| `totalRepositorySize` | Float | Total repository size of all projects in the root namespace in bytes |
| `totalRepositorySizeExcess` | Float | Total excess repository size of all projects in the root namespace in bytes |
| `visibility` | String | Visibility of the namespace |
### NamespaceIncreaseStorageTemporarilyPayload
......@@ -1882,6 +1894,7 @@ Autogenerated return type of PipelineRetry.
| Field | Type | Description |
| ----- | ---- | ----------- |
| `actualRepositorySizeLimit` | 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 |
......@@ -1928,6 +1941,7 @@ Autogenerated return type of PipelineRetry.
| `release` | Release | A single release of the project |
| `removeSourceBranchAfterMerge` | Boolean | Indicates if `Delete source branch` option should be enabled by default for all new merge requests of the project |
| `repository` | Repository | Git repository of the project |
| `repositorySizeExcess` | Float | Size of repository that exceeds the limit in bytes |
| `requestAccessEnabled` | Boolean | Indicates if users can request member access to the project |
| `requirement` | Requirement | Find a single requirement |
| `requirementStatesCount` | RequirementStatesCount | Number of requirements for the project by their state |
......
query getStorageCounter($fullPath: ID!) {
query getStorageCounter($fullPath: ID!, $withExcessStorageData: Boolean = false) {
namespace(fullPath: $fullPath) {
id
name
storageSizeLimit
actualRepositorySizeLimit @include(if: $withExcessStorageData)
additionalPurchasedStorageSize @include(if: $withExcessStorageData)
totalRepositorySizeExcess @include(if: $withExcessStorageData)
totalRepositorySize @include(if: $withExcessStorageData)
containsLockedProjects @include(if: $withExcessStorageData)
repositorySizeExcessProjectCount @include(if: $withExcessStorageData)
rootStorageStatistics {
storageSize
repositorySize
......@@ -20,6 +27,8 @@ query getStorageCounter($fullPath: ID!) {
avatarUrl
webUrl
name
repositorySizeExcess @include(if: $withExcessStorageData)
actualRepositorySizeLimit @include(if: $withExcessStorageData)
statistics {
commitCount
storageSize
......
......@@ -6,6 +6,38 @@ module EE
extend ActiveSupport::Concern
prepended do
field :additional_purchased_storage_size,
GraphQL::FLOAT_TYPE,
null: true,
description: 'Additional storage purchased for the root namespace in bytes'
field :total_repository_size_excess,
GraphQL::FLOAT_TYPE,
null: true,
description: 'Total excess repository size of all projects in the root namespace in bytes'
field :total_repository_size,
GraphQL::FLOAT_TYPE,
null: true,
description: 'Total repository size of all projects in the root namespace in bytes'
field :contains_locked_projects,
GraphQL::BOOLEAN_TYPE,
null: false,
description: 'Includes at least one project where the repository size exceeds the limit',
resolve: -> (obj, _args, _ctx) { obj.contains_locked_projects? }
field :repository_size_excess_project_count,
GraphQL::INT_TYPE,
null: false,
description: 'Number of projects in the root namespace where the repository size exceeds the limit'
field :actual_repository_size_limit,
GraphQL::FLOAT_TYPE,
null: true,
description: 'Size limit for repositories in the namespace in bytes',
resolve: -> (obj, _args, _ctx) { obj.actual_size_limit }
field :storage_size_limit,
GraphQL::FLOAT_TYPE,
null: true,
......
......@@ -115,6 +115,17 @@ module EE
description: 'Cluster agents associated with the project',
resolver: ::Resolvers::Clusters::AgentsResolver
field :repository_size_excess,
GraphQL::FLOAT_TYPE,
null: true,
description: 'Size of repository that exceeds the limit in bytes'
field :actual_repository_size_limit,
GraphQL::FLOAT_TYPE,
null: true,
description: 'Size limit for the repository in bytes',
resolve: -> (obj, _args, _ctx) { obj.actual_size_limit }
def self.sast_ci_configuration(project)
::Security::CiConfiguration::SastParserService.new(project).configuration
end
......
......@@ -4,7 +4,17 @@ require 'spec_helper'
RSpec.describe GitlabSchema.types['Namespace'] do
it 'has specific fields' do
expected_fields = %w[storage_size_limit is_temporary_storage_increase_enabled temporary_storage_increase_ends_on]
expected_fields = %w[
additional_purchased_storage_size
total_repository_size_excess
total_repository_size
contains_locked_projects
repository_size_excess_project_count
actual_repository_size_limit
storage_size_limit
is_temporary_storage_increase_enabled
temporary_storage_increase_ends_on
]
expect(described_class).to include_graphql_fields(*expected_fields)
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
security_dashboard_path iterations cluster_agents repository_size_excess actual_repository_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