Expose last_published_at field from the container registry
What does this MR do and why?
last_published_at
is now available in the Get Repository Details Container Registry API endpoint.
We want to expose this value to the frontend via GraphQL.
query {
containerRepository(id: "gid://gitlab/ContainerRepository/14") {
lastPublishedAt
}
}
MR acceptance checklist
How to set up and validate locally
Prerequisites:
A. Check that you have the latest version of the Container Registry, or at least 3.92.0
when this new field was added to the container registry.
B. Check that your Gitlab version locally is 16.11 and later.
C. Push a tag to a container repository
D. Verify that the Gitlab API is supported:
ContainerRegistry::GitlabApiClient..supports_gitlab_api?
#=> true
Steps:
- In the GraphQL explorer,
http://gdk.test:3000/-/graphql-explorer
, give the following query. Replace16
with the container repository ID that you have locally.
query {
containerRepository(id: "gid://gitlab/ContainerRepository/16") {
lastPublishedAt
}
}
- For a container repository that had a tag pushed recently,
lastPublishedAt
would be filled up:
{
"data": {
"containerRepository": {
"lastPublishedAt": "2024-04-30T06:07:36+00:00"
}
}
}
If the lastPublishedAt
is still null
, verify that you have the latest container registry and gitlab version. Push a new tag to make sure that it gets recorded by the container registry
- For a container repository that did not have a pushed tag, we expect
lastPublishedAt
to benull
{
"data": {
"containerRepository": {
"lastPublishedAt": null
}
}
}
Related to #290949 (closed)