Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2024-01-11 03:08:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2024-01-11 03:08:09 +0300
commita18ca85c05efe431c3a1faf6c9f4257638b73493 (patch)
treeab088ce168ac378f8224c821f33f500b28369df5 /app/services/groups
parent853e0ceb61507ce55521776c84bc77b4e802c66e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/groups')
-rw-r--r--app/services/groups/update_service.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/services/groups/update_service.rb b/app/services/groups/update_service.rb
index d91e09d212a..a6ef8c8743b 100644
--- a/app/services/groups/update_service.rb
+++ b/app/services/groups/update_service.rb
@@ -29,6 +29,8 @@ module Groups
handle_namespace_settings
+ handle_hierarchy_cache_update
+
group.assign_attributes(params)
begin
@@ -46,6 +48,28 @@ module Groups
private
+ def handle_hierarchy_cache_update
+ return unless params.key?(:enable_namespace_descendants_cache)
+
+ enabled = Gitlab::Utils.to_boolean(params.delete(:enable_namespace_descendants_cache))
+
+ return unless Feature.enabled?(:group_hierarchy_optimization, group, type: :beta)
+
+ if enabled
+ return if group.namespace_descendants
+
+ params[:namespace_descendants_attributes] = {
+ traversal_ids: group.traversal_ids,
+ all_project_ids: [],
+ self_and_descendant_group_ids: []
+ }
+ else
+ return unless group.namespace_descendants
+
+ params[:namespace_descendants_attributes] = { id: group.id, _destroy: true }
+ end
+ end
+
def valid_path_change?
return true unless group.packages_feature_enabled?
return true if params[:path].blank?