Repositories stuck in non-final migration statuses due to being deleted on the Rails side
Problem
Yesterday we spotted a few repositories on the registry side that have a migration status of pre_import_complete
or pre_import_failed
. We then realized these repositories no longer exist on the Rails side.
Looking at logs, we could also see that all tags under these repositories have been deleted after the pre-import started and before the final import. The bulk deletion is compatible with what happens when a user deletes a repository on the Rails UI (which causes all tags to be deleted and then the actual container repository record on the Rails database is also deleted).
Consequently, Rails will no longer trigger a final import (because the repository record no longer exists there). These repositories will be left in non-final migration statuses on the registry side.
Solution
The root cause lies on the Rails side: gitlab#361330 (closed). Apart from that, on the registry side, we need to decide what to do about these repository records. We might need to compile a list of them at the end of the migration and create a change request to update them.