Fix number of tags label after deleting tags
requested to merge dannyelcf/gitlab:349510-dcf-number-of-tags-label-does-not-update-after-deleting-tags into master
What does this MR do and why?
Fix the tags counter update after delete tags in Container Registry page.
The solution is to refresh Apollo cache using the refetchQueries
strategy (which was already used but it was necessary to fix the current query and add another one).
To fix the current query it was used @connection
directive as mentioned here: https://docs.gitlab.com/ee/development/fe_guide/graphql.html#pagination-and-optimistic-updates
Screenshots or screen recordings
On success to delete the tags
On failure to delete the tags
How to set up and validate locally
- In
gitlab-development-kit/gitlab/config/gitlab.yml
enable registry
registry:
enabled: true
- In your local machine, start the registry container
- To succeed in delete case
docker run -d -p 5000:5000 -e REGISTRY_STORAGE_DELETE_ENABLED=true --restart=always --name registry registry:2
- To fail in delete case (without
-e REGISTRY_STORAGE_DELETE_ENABLED=true
)
docker run -d -p 5000:5000 --restart=always --name registry registry:2
- Create a simple Dockerfile with the content:
FROM scratch
CMD /bin/true
- Log in the registry container
docker login gdk.test:5000
- Build many images and tag them
for i in `seq -f "%02g" 1 30`; do docker build -t gdk.test:5000/twitter/typeahead.js:tag$i .; done
- Push the image tags to the local registry running at gdk.test:5000
for i in `seq -f "%02g" 1 30`; do docker push gdk.test:5000/twitter/typeahead.js:tag$i; done
- Run
gdk start
and go to the Container Registry page.
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 #349510 (closed)
Edited by Dannyel Cardoso da Fonseca