Skip to content

Displays the last published date for container repository

What does this MR do and why?

Displays the last published date for container repository.

The field was added in Expose last_published_at field from the contain... (!151506 - merged) to the GraphQL API.

This is shown in the container registry details page. lastPublishedAt field can be null from GraphQL, so this MR also handles that scenario.

Edit: Added couple of extra commits which

  • Updates registry header to display images count with larger size (fixes issue mentioned in internal discussion)
  • Updates details_header to conditionally fetch metadata based on metadata database enabled flag #290949 (comment 1911945594)

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
Screenshot_2024-05-16_at_11.47.54_PM Screenshot_2024-05-20_at_12.04.54_PM

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 tags list page in group & project view

  6. Confirm that last published date is visible on the image repository details header

  7. Confirm that when container registry metadata database is disabled & GITLAB_SIMULATE_SAAS is not set, last published date is not visible on the image repository,

Related to #290949 (closed)

Edited by Rahul Chanila

Merge request reports