Display the last published date for container repositories
Context
Have you ever been looking at a container repository in the user interface and noticed that we display the creation date and found yourself asking, why don't they show me when an image was last published to this repository?
This was done because there were some performance concerns about displaying the last published date. It was discovered in #216795 (comment 459996750) that displaying the last published date in the registry UI was too computationally expensive and negatively impacted the performance of the app. But that information is valuable for folks that need that information to be sure they are using the correct image.
Problem to solve
With &5523 (closed) now complete, we can develop a new solution to address this.
The intent is to display a "last published" timestamp in the repository header alongside the creation timestamp. The displayed timestamp should match the published timestamp of the most recently created/updated tag in the repository.
Steps
-
golang Add a new
last_published_at
to the registry Get repository details API response. This is a computed attribute that should be set to the most recent published timestamp (GREATEST(created_at, published_at)
) across all tags in the target repository; -
rails Expose the new
last_published_at
received from the registry in the response to the frontendContainerRepositoryDetails
request. Internally, we're already calling the registry Get repository details API to obtain and display the size of the repository in the same UI header, so we just need to expand that information. -
frontend Display last published timestamp.
Implementation guide
frontend
To maintain backwards compatibility across updates, frontend changes need to released in subsequent milestone.
- Add
publishedAt
field inapp/assets/javascripts/packages_and_registries/container_registry/explorer/graphql/queries/get_container_repository_metadata.query.graphql
- Add similar metadata template which renders the published time.