Update permanent deletion logic to allow for namespace to change after marked for deletion
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
This change fixes a bug in the GitLab group deletion process. Previously, when permanently deleting a group that was already soft-deleted, the code was using outdated group information (like the group's path) that might have changed during the soft-delete process.
The fix ensures that when permanently deleting a group, the code first retrieves the current state of the soft-deleted group to get its up-to-date path information, then uses that fresh information for the permanent deletion. This prevents errors that could occur if the group's path was modified during the soft-delete phase.
The same fix is applied to project deletion and test cleanup functions to ensure consistency across the codebase. This makes the deletion process more reliable by always using current object information rather than potentially stale data.
Fixes #6577 (closed)