Skip to content

Fix number of tags label after deleting tags

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

Recording_2022-11-05_at_13.08.12

On failure to delete the tags

Recording_2022-11-05_at_13.13.57

How to set up and validate locally

  1. In gitlab-development-kit/gitlab/config/gitlab.yml enable registry
registry:
  enabled: true
  1. 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
  1. Create a simple Dockerfile with the content:
FROM scratch
CMD /bin/true
  1. Log in the registry container
docker login gdk.test:5000
  1. 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
  1. 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
  1. 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.

Related to #349510 (closed)

Edited by Dannyel Cardoso da Fonseca

Merge request reports