Commit 6dd5eaad authored by Fabio Huser's avatar Fabio Huser Committed by Sean McGivern

Backfill group type in GraphQL API

parent 49d44e93
......@@ -17,6 +17,25 @@ module Types
group.avatar_url(only_path: false)
end
field :share_with_group_lock, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates if sharing a project with another group within this group is prevented'
field :project_creation_level, GraphQL::STRING_TYPE, null: true, method: :project_creation_level_str,
description: 'The permission level required to create projects in the group'
field :subgroup_creation_level, GraphQL::STRING_TYPE, null: true, method: :subgroup_creation_level_str,
description: 'The permission level required to create subgroups within the group'
field :require_two_factor_authentication, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates if all users in this group are required to set up two-factor authentication'
field :two_factor_grace_period, GraphQL::INT_TYPE, null: true,
description: 'Time before two-factor authentication is enforced'
field :auto_devops_enabled, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates whether Auto DevOps is enabled for all projects within this group'
field :emails_disabled, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates if a group has email notifications disabled'
field :mentions_disabled, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates if a group is disabled from getting mentioned'
......
---
title: Backfill missing GraphQL API Group type properties
merge_request: 23389
author: Fabio Huser
type: added
......@@ -2434,6 +2434,11 @@ type GrafanaIntegration {
}
type Group {
"""
Indicates whether Auto DevOps is enabled for all projects within this group
"""
autoDevopsEnabled: Boolean
"""
Avatar URL of the group
"""
......@@ -2449,6 +2454,11 @@ type Group {
"""
descriptionHtml: String
"""
Indicates if a group has email notifications disabled
"""
emailsDisabled: Boolean
"""
Find a single epic
"""
......@@ -2623,6 +2633,11 @@ type Group {
"""
path: String!
"""
The permission level required to create projects in the group
"""
projectCreationLevel: String
"""
Projects within this namespace
"""
......@@ -2658,11 +2673,26 @@ type Group {
"""
requestAccessEnabled: Boolean
"""
Indicates if all users in this group are required to set up two-factor authentication
"""
requireTwoFactorAuthentication: Boolean
"""
Aggregated storage statistics of the namespace. Only available for root namespaces
"""
rootStorageStatistics: RootStorageStatistics
"""
Indicates if sharing a project with another group within this group is prevented
"""
shareWithGroupLock: Boolean
"""
The permission level required to create subgroups within the group
"""
subgroupCreationLevel: String
"""
Time logged in issues by group members
"""
......@@ -2698,6 +2728,11 @@ type Group {
startDate: Time!
): TimelogConnection!
"""
Time before two-factor authentication is enforced
"""
twoFactorGracePeriod: Int
"""
Permissions for the current user on the resource
"""
......
......@@ -3044,6 +3044,20 @@
"name": "Group",
"description": null,
"fields": [
{
"name": "autoDevopsEnabled",
"description": "Indicates whether Auto DevOps is enabled for all projects within this group",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "avatarUrl",
"description": "Avatar URL of the group",
......@@ -3086,6 +3100,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "emailsDisabled",
"description": "Indicates if a group has email notifications disabled",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "epic",
"description": "Find a single epic",
......@@ -3524,6 +3552,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "projectCreationLevel",
"description": "The permission level required to create projects in the group",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "projects",
"description": "Projects within this namespace",
......@@ -3605,6 +3647,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "requireTwoFactorAuthentication",
"description": "Indicates if all users in this group are required to set up two-factor authentication",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "rootStorageStatistics",
"description": "Aggregated storage statistics of the namespace. Only available for root namespaces",
......@@ -3619,6 +3675,34 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "shareWithGroupLock",
"description": "Indicates if sharing a project with another group within this group is prevented",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "subgroupCreationLevel",
"description": "The permission level required to create subgroups within the group",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "timelogs",
"description": "Time logged in issues by group members",
......@@ -3704,6 +3788,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "twoFactorGracePeriod",
"description": "Time before two-factor authentication is enforced",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "userPermissions",
"description": "Permissions for the current user on the resource",
......
......@@ -393,6 +393,13 @@ Autogenerated return type of EpicTreeReorder
| `userPermissions` | GroupPermissions! | Permissions for the current user on the resource |
| `webUrl` | String! | Web URL of the group |
| `avatarUrl` | String | Avatar URL of the group |
| `shareWithGroupLock` | Boolean | Indicates if sharing a project with another group within this group is prevented |
| `projectCreationLevel` | String | The permission level required to create projects in the group |
| `subgroupCreationLevel` | String | The permission level required to create subgroups within the group |
| `requireTwoFactorAuthentication` | Boolean | Indicates if all users in this group are required to set up two-factor authentication |
| `twoFactorGracePeriod` | Int | Time before two-factor authentication is enforced |
| `autoDevopsEnabled` | Boolean | Indicates whether Auto DevOps is enabled for all projects within this group |
| `emailsDisabled` | Boolean | Indicates if a group has email notifications disabled |
| `mentionsDisabled` | Boolean | Indicates if a group is disabled from getting mentioned |
| `parent` | Group | Parent group |
| `epicsEnabled` | Boolean | Indicates if Epics are enabled for namespace |
......
......@@ -10,7 +10,14 @@ describe GitlabSchema.types['Group'] do
it { expect(described_class).to require_graphql_authorizations(:read_group) }
it 'has the expected fields' do
expected_fields = %w[web_url avatar_url mentions_disabled parent]
expected_fields = %w[
id name path full_name full_path description description_html visibility
lfs_enabled request_access_enabled projects root_storage_statistics
web_url avatar_url share_with_group_lock project_creation_level
subgroup_creation_level require_two_factor_authentication
two_factor_grace_period auto_devops_enabled emails_disabled
mentions_disabled parent
]
is_expected.to include_graphql_fields(*expected_fields)
end
......
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