The source project of this merge request has been removed.
Take migration status into account for size
What does this MR do and why?
This addresses #359127 (closed), by allowing size calculation if a repository has migration_state of 'import_done'.
How to set up and validate locally
- Follow the steps in !80412 (merged) for setting up the container registry
- Build and upload a Docker image to a project's repository. Visit the repo page to get the repository id
- curl (or postman)
http://gdk.test:3000/api/v4/registry/repositories/<repository-id>?size=true - observe whether "size" in the response is null or not. If null, the size calculation is being bypassed.
Test cases. Use gdk psql to change values for the repository in the container_repositories table as follows:
- change migration_status to "default" and created_at to any date before Nov 4, 2021. API request above should return a null size
- change migration_status to "import_done" and created_at to any date before Nov 4, 2021. API request above should NOT return a null size
- change migration_status to "default" and created_at to any date after Nov 4, 2021. API request above should NOT return a null size
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 to #359127 (closed)