Show error message when deleting container images
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do and why?
Protected containers: Show error details when deleting container images
This change refactors the code to display specific error details when the image deletion fails, providing better feedback to the user.
At the moment when deleting container images, the user is shown a generic error message without any details about the failure.
Changelog: other
References
- Protected containers: Integrate delete protecti... (!183545 - merged) <= The referenced MR returns an error when the container repository is protected from deletion. It would be good if this error gets also shown to the user for more clarity.
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Add the following line to the GraphQL mutation
DestroyContainerRepositoryin order to trigger an error from the backend (that is then picked up by the frontend changes from this MR)
raise Gitlab::Graphql::Errors::BaseError, 'Custom error'
- Go to the container registry: http://gdk.test:3000/flightjs/Flight/container_registry
- Try to delete any image
- You should see the custom error message in the error as shown above
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.
Related to #406797
Edited by Gerardo Navarro

