From 835c141d82e1a3f5e68d0675d9f49b9054dbcd3b Mon Sep 17 00:00:00 2001 From: Agnes Slota Date: Wed, 23 Jul 2025 16:25:10 +1000 Subject: [PATCH 1/2] Expose hasStatusesFeature GraphQL field Add the hasStatusesFeature field to the licensedFeatures GraphQL API. Changelog: added --- .../types/namespaces/available_features_type.rb | 11 +++++++++++ doc/api/graphql/reference/_index.md | 1 + .../types/namespaces/available_features_type_spec.rb | 1 + .../namespaces/available_features_shared_examples.rb | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/graphql/types/namespaces/available_features_type.rb b/app/graphql/types/namespaces/available_features_type.rb index 21d2f584fef1dd..3b6db1868a5e34 100644 --- a/app/graphql/types/namespaces/available_features_type.rb +++ b/app/graphql/types/namespaces/available_features_type.rb @@ -77,6 +77,13 @@ class AvailableFeaturesType < BaseObject # rubocop:disable Graphql/AuthorizeType resolver_method: :subepics_enabled?, experiment: { milestone: '18.1' } + field :has_statuses_feature, + GraphQL::Types::Boolean, + null: false, + description: 'Whether work item statuses are enabled for the namespace.', + resolver_method: :statuses_enabled?, + experiment: { milestone: '18.3' } + def epics_enabled? object.licensed_feature_available?(:epics) end @@ -116,6 +123,10 @@ def scoped_labels_enabled? def subepics_enabled? object.licensed_feature_available?(:subepics) end + + def statuses_enabled? + object.licensed_feature_available?(:work_item_status) + end end end end diff --git a/doc/api/graphql/reference/_index.md b/doc/api/graphql/reference/_index.md index 41a8e87c511485..71df41127a417e 100644 --- a/doc/api/graphql/reference/_index.md +++ b/doc/api/graphql/reference/_index.md @@ -35637,6 +35637,7 @@ four standard [pagination arguments](#pagination-arguments): | `hasOkrsFeature` {{< icon name="warning-solid" >}} | [`Boolean!`](#boolean) | **Introduced** in GitLab 18.1. **Status**: Experiment. Whether OKRs are enabled for the namespace. | | `hasQualityManagementFeature` {{< icon name="warning-solid" >}} | [`Boolean!`](#boolean) | **Introduced** in GitLab 18.1. **Status**: Experiment. Whether quality management is enabled for the namespace. | | `hasScopedLabelsFeature` {{< icon name="warning-solid" >}} | [`Boolean!`](#boolean) | **Introduced** in GitLab 18.1. **Status**: Experiment. Whether scoped labels are enabled for the namespace. | +| `hasStatusesFeature` {{< icon name="warning-solid" >}} | [`Boolean!`](#boolean) | **Introduced** in GitLab 18.3. **Status**: Experiment. Whether work item statuses are enabled for the namespace. | | `hasSubepicsFeature` {{< icon name="warning-solid" >}} | [`Boolean!`](#boolean) | **Introduced** in GitLab 18.1. **Status**: Experiment. Whether subepics are enabled for the namespace. | ### `NamespaceBan` diff --git a/ee/spec/graphql/ee/types/namespaces/available_features_type_spec.rb b/ee/spec/graphql/ee/types/namespaces/available_features_type_spec.rb index 9e3aed3dfde480..807fca654cfcd3 100644 --- a/ee/spec/graphql/ee/types/namespaces/available_features_type_spec.rb +++ b/ee/spec/graphql/ee/types/namespaces/available_features_type_spec.rb @@ -19,6 +19,7 @@ :has_quality_management_feature | :quality_management :has_scoped_labels_feature | :scoped_labels :has_subepics_feature | :subepics + :has_statuses_feature | :work_item_status end with_them do diff --git a/spec/support/shared_examples/graphql/types/namespaces/available_features_shared_examples.rb b/spec/support/shared_examples/graphql/types/namespaces/available_features_shared_examples.rb index 953e66d8687097..2d62bfd91bea33 100644 --- a/spec/support/shared_examples/graphql/types/namespaces/available_features_shared_examples.rb +++ b/spec/support/shared_examples/graphql/types/namespaces/available_features_shared_examples.rb @@ -8,7 +8,7 @@ specify do expected_fields = %i[has_issue_weights_feature has_iterations_feature has_okrs_feature has_subepics_feature has_issuable_health_status_feature has_epics_feature has_scoped_labels_feature has_quality_management_feature - has_linked_items_epics_feature has_issue_date_filter_feature] + has_linked_items_epics_feature has_issue_date_filter_feature has_statuses_feature] expect(described_class).to have_graphql_fields(*expected_fields) end -- GitLab From c65c21d746077acc854902bcf16961a919019ada Mon Sep 17 00:00:00 2001 From: Agnes Slota Date: Thu, 24 Jul 2025 15:09:11 +1000 Subject: [PATCH 2/2] Expose adminWorkItemLifecycle GraphQL field Add the adminWorkItemLifecycle field to the userPermissions GraphQL API. --- app/graphql/types/permission_types/group.rb | 2 +- app/graphql/types/permission_types/project.rb | 2 +- doc/api/graphql/reference/_index.md | 2 ++ spec/graphql/types/permission_types/group_spec.rb | 2 +- spec/graphql/types/permission_types/project_spec.rb | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/graphql/types/permission_types/group.rb b/app/graphql/types/permission_types/group.rb index 1ab4eedaa26dae..d3a04a0e1d671e 100644 --- a/app/graphql/types/permission_types/group.rb +++ b/app/graphql/types/permission_types/group.rb @@ -6,7 +6,7 @@ class Group < BasePermissionType graphql_name 'GroupPermissions' abilities :read_group, :create_projects, :create_custom_emoji, :remove_group, :view_edit_page, - :admin_issue, :read_crm_contact, :read_crm_organization + :admin_issue, :read_crm_contact, :read_crm_organization, :admin_work_item_lifecycle permission_field :can_leave, description: 'If `true`, the user can leave this group.' diff --git a/app/graphql/types/permission_types/project.rb b/app/graphql/types/permission_types/project.rb index 73288168a58fba..455928a34f1076 100644 --- a/app/graphql/types/permission_types/project.rb +++ b/app/graphql/types/permission_types/project.rb @@ -19,7 +19,7 @@ class Project < BasePermissionType :create_pages, :destroy_pages, :read_pages_content, :admin_operations, :read_merge_request, :read_design, :create_design, :update_design, :destroy_design, :move_design, :read_environment, :view_edit_page, :admin_issue, :create_work_item, - :import_issues, :read_crm_contact, :read_crm_organization + :import_issues, :read_crm_contact, :read_crm_organization, :admin_work_item_lifecycle permission_field :create_snippet diff --git a/doc/api/graphql/reference/_index.md b/doc/api/graphql/reference/_index.md index 71df41127a417e..84e19bd0708864 100644 --- a/doc/api/graphql/reference/_index.md +++ b/doc/api/graphql/reference/_index.md @@ -31452,6 +31452,7 @@ Returns [`String`](#string). | Name | Type | Description | | ---- | ---- | ----------- | | `adminIssue` | [`Boolean!`](#boolean) | If `true`, the user can perform `admin_issue` on this resource. | +| `adminWorkItemLifecycle` | [`Boolean!`](#boolean) | If `true`, the user can perform `admin_work_item_lifecycle` on this resource. | | `canLeave` | [`Boolean!`](#boolean) | If `true`, the user can leave this group. | | `createCustomEmoji` | [`Boolean!`](#boolean) | If `true`, the user can perform `create_custom_emoji` on this resource. | | `createProjects` | [`Boolean!`](#boolean) | If `true`, the user can perform `create_projects` on this resource. | @@ -39876,6 +39877,7 @@ Returns [`String`](#string). | `adminProject` | [`Boolean!`](#boolean) | If `true`, the user can perform `admin_project` on this resource. | | `adminRemoteMirror` | [`Boolean!`](#boolean) | If `true`, the user can perform `admin_remote_mirror` on this resource. | | `adminWiki` | [`Boolean!`](#boolean) | If `true`, the user can perform `admin_wiki` on this resource. | +| `adminWorkItemLifecycle` | [`Boolean!`](#boolean) | If `true`, the user can perform `admin_work_item_lifecycle` on this resource. | | `archiveProject` | [`Boolean!`](#boolean) | If `true`, the user can perform `archive_project` on this resource. | | `changeNamespace` | [`Boolean!`](#boolean) | If `true`, the user can perform `change_namespace` on this resource. | | `changeVisibilityLevel` | [`Boolean!`](#boolean) | If `true`, the user can perform `change_visibility_level` on this resource. | diff --git a/spec/graphql/types/permission_types/group_spec.rb b/spec/graphql/types/permission_types/group_spec.rb index f05b0bf1721bc0..47a259f98d4def 100644 --- a/spec/graphql/types/permission_types/group_spec.rb +++ b/spec/graphql/types/permission_types/group_spec.rb @@ -8,7 +8,7 @@ it 'has the correct permissions' do expected_permissions = [ :read_group, :create_projects, :create_custom_emoji, :remove_group, :view_edit_page, :can_leave, - :admin_issue, :read_crm_contact, :read_crm_organization + :admin_issue, :read_crm_contact, :read_crm_organization, :admin_work_item_lifecycle ] expected_permissions.each do |permission| diff --git a/spec/graphql/types/permission_types/project_spec.rb b/spec/graphql/types/permission_types/project_spec.rb index 3e73b22f8c0e7e..5ea8a3fdb8c288 100644 --- a/spec/graphql/types/permission_types/project_spec.rb +++ b/spec/graphql/types/permission_types/project_spec.rb @@ -19,7 +19,7 @@ :create_pages, :destroy_pages, :read_pages_content, :admin_operations, :read_merge_request, :read_design, :create_design, :update_design, :destroy_design, :move_design, :read_environment, :view_edit_page, :admin_issue, :create_work_item, - :import_issues, :read_crm_contact, :read_crm_organization + :import_issues, :read_crm_contact, :read_crm_organization, :admin_work_item_lifecycle ] expected_permissions.each do |permission| -- GitLab