Skip to content

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
Screenshot_2025-10-28_at_9.08.06_pm Screenshot_2025-10-28_at_9.08.38_pm

How to set up and validate locally

  1. Enable archive_group, destroy_fork_network_on_archive, and destroy_fork_network_on_group_archive
  2. Create a group
  3. Create a project under the group
  4. Fork the project
  5. Create a MR from the fork
  6. Go back to the group -> settings -> general -> archive
  7. Check if the project has been also archived, if the fork relationship has been removed, and the open MR has been closed.
  8. 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.

Edited by Emma Park

Merge request reports

Loading