Disable image deletion during registry migration
🌻 What does this MR do and why?
We are in the process of migrating all container repositories to the new container registry.
While a given container repository is importing, users are not able to delete it or its underlying tags. In #352079 (closed), we added a custom message when a tag deletion fails due to this import process.
In this MR, we disable the delete button for the container repository while it is being imported on the container repository list page.
📷 Screenshots or screen recordings
Not importing | Importing |
---|---|
💻 How to set up and validate locally
- Create a container repository in a project by pushing an image, or using FactoryBot in the rails console:
# it might be helpful to note the ID of the created record here FactoryBot.create(:container_repository, project: Project.last)
- Visit the project page, then navigate to
Packages & Registries -> Container Registry
. The container repository you created should be visible and the delete button should be active. - In the rails or postgresql console, update the container repository
migration_state
to'importing'
:# in the rails console ContainerRepository.last.update_column(:migration_state, 'importing') # in the psql console UPDATE container_repositories SET migration_state = 'importing' WHERE id = <your container repository id here>
- Reload the container registry page in the UI. The delete button should no longer be active and a tooltip should appear upon hovering.
🛃 MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related #356108 (closed)
Edited by Steve Abrams