Reschedule MR cleanups for native Mercurial projects
A consequence of #423 (closed) is that Merge Requests special refs didn't get cleaned up as they should have, at first by failing (loudly), then by being ignored (still the case as of Heptapod 0.20.0).
We need to reschedule them in a background migration after native Mercurial projects get proper support for special refs (#431 (closed)), which should include deletion. This can be done with the MergeRequests::CleanupRefsService.schedule
classmethod.
Normally these cleanups happen in MergeRequests::PostMergeService
and MergeRequests::CloseService
, hence we can perform them for all closed
and merged
MRs. We can expect the volume to be much lower than what this scheduling is designed for, but we can as well use it, provided we don't get failures if it fails (MR closed post #431 (closed), hence whose special refs are already cleaned up) or we just accept the failures and subsequent retries because they are low volume.