summaryrefslogtreecommitdiff
path: root/lib/api/groups.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/groups.rb')
-rw-r--r--lib/api/groups.rb32
1 files changed, 17 insertions, 15 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb
index 5fbf222be5d..0ed14476c61 100644
--- a/lib/api/groups.rb
+++ b/lib/api/groups.rb
@@ -7,10 +7,10 @@ module API
before { authenticate_non_get! }
- feature_category :subgroups
-
helpers Helpers::GroupsHelpers
+ feature_category :subgroups, ['/groups/:id/custom_attributes', '/groups/:id/custom_attributes/:key']
+
helpers do
params :statistics_params do
optional :statistics, type: Boolean, default: false, desc: 'Include project statistics'
@@ -181,7 +181,7 @@ module API
use :group_list_params
use :with_custom_attributes
end
- get do
+ get feature_category: :subgroups do
groups = find_groups(declared_params(include_missing: false), params[:id])
present_groups_with_pagination_strategies params, groups
end
@@ -196,7 +196,7 @@ module API
use :optional_params
end
- post do
+ post feature_category: :subgroups do
parent_group = find_group!(params[:parent_id]) if params[:parent_id].present?
if parent_group
authorize! :create_subgroup, parent_group
@@ -229,7 +229,7 @@ module API
use :optional_update_params
use :optional_update_params_ee
end
- put ':id' do
+ put ':id', feature_category: :subgroups do
group = find_group!(params[:id])
group.preload_shared_group_links
@@ -249,7 +249,8 @@ module API
use :with_custom_attributes
optional :with_projects, type: Boolean, default: true, desc: 'Omit project details'
end
- get ":id" do
+ # TODO: Set higher urgency after resolving https://gitlab.com/gitlab-org/gitlab/-/issues/357841
+ get ":id", feature_category: :subgroups, urgency: :low do
group = find_group!(params[:id])
group.preload_shared_group_links
@@ -265,7 +266,7 @@ module API
end
desc 'Remove a group.'
- delete ":id" do
+ delete ":id", feature_category: :subgroups do
group = find_group!(params[:id])
authorize! :admin_group, group
check_subscription! group
@@ -300,7 +301,8 @@ module API
use :with_custom_attributes
use :optional_projects_params
end
- get ":id/projects" do
+ # TODO: Set higher urgency after resolving https://gitlab.com/gitlab-org/gitlab/-/issues/211498
+ get ":id/projects", feature_category: :subgroups, urgency: :low do
finder_options = {
only_owned: !params[:with_shared],
include_subgroups: params[:include_subgroups],
@@ -334,7 +336,7 @@ module API
use :pagination
use :with_custom_attributes
end
- get ":id/projects/shared" do
+ get ":id/projects/shared", feature_category: :subgroups do
projects = find_group_projects(params, { only_shared: true })
present_projects(params, projects)
@@ -347,7 +349,7 @@ module API
use :group_list_params
use :with_custom_attributes
end
- get ":id/subgroups" do
+ get ":id/subgroups", feature_category: :subgroups, urgency: :low do
groups = find_groups(declared_params(include_missing: false), params[:id])
present_groups params, groups
end
@@ -359,7 +361,7 @@ module API
use :group_list_params
use :with_custom_attributes
end
- get ":id/descendant_groups" do
+ get ":id/descendant_groups", feature_category: :subgroups do
finder_params = declared_params(include_missing: false).merge(include_parent_descendants: true)
groups = find_groups(finder_params, params[:id])
present_groups params, groups
@@ -371,7 +373,7 @@ module API
params do
requires :project_id, type: String, desc: 'The ID or path of the project'
end
- post ":id/projects/:project_id", requirements: { project_id: /.+/ } do
+ post ":id/projects/:project_id", requirements: { project_id: /.+/ }, feature_category: :projects do
authenticated_as_admin!
group = find_group!(params[:id])
group.preload_shared_group_links
@@ -391,7 +393,7 @@ module API
desc: 'The ID of the target group to which the group needs to be transferred to.'\
'If not provided, the source group will be promoted to a root group.'
end
- post ':id/transfer' do
+ post ':id/transfer', feature_category: :subgroups do
group = find_group!(params[:id])
authorize! :admin_group, group
@@ -415,7 +417,7 @@ module API
requires :group_access, type: Integer, values: Gitlab::Access.all_values, desc: 'The group access level'
optional :expires_at, type: Date, desc: 'Share expiration date'
end
- post ":id/share" do
+ post ":id/share", feature_category: :subgroups do
shared_group = find_group!(params[:id])
shared_with_group = find_group!(params[:group_id])
@@ -438,7 +440,7 @@ module API
requires :group_id, type: Integer, desc: 'The ID of the shared group'
end
# rubocop: disable CodeReuse/ActiveRecord
- delete ":id/share/:group_id" do
+ delete ":id/share/:group_id", feature_category: :subgroups do
shared_group = find_group!(params[:id])
link = shared_group.shared_with_group_links.find_by(shared_with_group_id: params[:group_id])