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
- Enable the
cascade_unarchive_groupon http://localhost:3000/rails/features/ - Create the following group/project structure:
Parent > Subgroup > Project - Go to
http://localhost:3000/parent/subgroup/project/edit#js-project-advanced-settingsand archive the project. - Go to
http://localhost:3000/groups/parent/subgroup/-/edit#js-advanced-settingsto archive the subgroup. - Go to
http://localhost:3000/groups/parent/-/edit#js-advanced-settingsto archive the top-level group. - Go to
http://localhost:3000/groups/parent/-/edit#js-advanced-settingsto unarchive the top-level group. - 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