Skip to content

Add metadata database alert to registry pages in the UI

What does this MR do and why?

Add metadata database alert to registry pages in the UI

Adds new shared alert component which is imported in:

  • container registry list page for groups & projects
  • project packages & registries settings

Implementation is similar to !100784 (merged) not be blocked by backend we store that the alert was dismissed in a cookie value but if the user logs into the page in a different browser they will see the alert again.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
No alert Screenshot_2024-03-27_at_11.21.32_AM
No alert Screenshot_2024-04-03_at_12.13.10_AM

How to set up and validate locally

  1. Setup & enable Container Registry https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/registry.md

  2. Make sure to enable the metadata database https://gitlab.com/gitlab-org/container-registry/-/blob/master/docs/database-local-setup.md?ref_type=heads

  3. Follow steps in https://gitlab.com/gitlab-org/ci-cd/package-stage/package/-/wikis/Packages-Tips-&-Tricks#how-to-add-images-with-tags-quickly-to-the-registry

  4. Run the following in the terminal

    $ ./publish.sh <project-path> 5 1 127.0.0.1:5000 # creates 1 image with 5 tags
  5. Visit the container registry image list page in group & project view

  6. Confirm that alert is displayed & closing the alert does not show up anymore when refreshed.

  7. Clear the cookie hide_metadata_database_alert & visit Project > Settings > Packages & Registries

  8. Confirm that alert is displayed & closing the alert does not show up anymore when refreshed.

  9. Enable the metadata database https://gitlab.com/gitlab-org/container-registry/-/blob/master/docs/database-local-setup.md?ref_type=heads

  10. Confirm that alert is not displayed in container registry image list page in group & project view and under Project > Settings > Packages & Registries

Related to #442701 (closed)

Edited by Rahul Chanila

Merge request reports