Unarchive descendants when toggling group's archive state

What does this MR do and why?

When toggling the archive state of a group, automatically unarchive its descendant groups and projects.

This is done sync as we don't expect a group to have a large number of archived descendants. Otherwise, we can consider moving the operation into a worker later on.

Query Plans

NamespaceSettings Update: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/46270/commands/141225

Project Update: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/46270/commands/141234

References

Related to #578499

Screenshots or screen recordings

Before After
Screen_Recording_2025-12-09_at_12.35.41_PM Screen_Recording_2025-12-09_at_12.34.53_PM

How to set up and validate locally

  1. Enable the cascade_unarchive_group on http://localhost:3000/rails/features/
  2. Create the following group/project structure: Parent > Subgroup > Project
  3. Go to http://localhost:3000/parent/subgroup/project/edit#js-project-advanced-settings and archive the project.
  4. Go to http://localhost:3000/groups/parent/subgroup/-/edit#js-advanced-settings to archive the subgroup.
  5. Go to http://localhost:3000/groups/parent/-/edit#js-advanced-settings to archive the top-level group.
  6. Go to http://localhost:3000/groups/parent/-/edit#js-advanced-settings to unarchive the top-level group.
  7. Verify that all groups and projects in the hierarchy are now in an active state.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Shane Maglangit

Merge request reports

Loading