Unlink fork relationships when archiving group
What does this MR do and why?
Related: https://gitlab.com/gitlab-org/gitlab/-/issues/572482
The previous MR removes the fork relationship and closes the MRs when the upstream project is archived. However, it only works for individual projects. When projects belong to a group and the group is archived, the fork relationships remain active and the MRs stay open.
This MR fixes the problem by removing fork relationships and closing MRs when a group is archived.
The Rack::Timeout of 60 seconds would terminate the archive API request if the group has many projects, each with numerous open MRs. Therefore, unlinking fork relationships and closing open MRs are processed asynchronously using a background worker.
References
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Enable
archive_group,destroy_fork_network_on_archive, anddestroy_fork_network_on_group_archive - Create a group
- Create a project under the group
- Fork the project
- Create a MR from the fork
- Go back to the group -> settings -> general -> archive
- Check if the project has been also archived, if the fork relationship has been removed, and the open MR has been closed.
- If you check all boxes, mission accomplished!!!
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.

