Skip to content

Remove Gitlab.com check for last_published_at

What does this MR do and why?

Issue link: #458820 (closed)

In this MR, we enable the last_published_at field on ContainerRepository even for self-managed, as long as the Gitlab API is available. This is an effort to drive the migration of self-managed customers to the new container registry.

Previously, we had two checks:

  • Gitlab.com?
  • Gitlab API is supported?

Now, we only want to check if the Gitlab API is supported as we will query the field from there.

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.

Screenshot

The Last Published At will have a value even for non-SAAS setups.

Screenshot_2024-06-27_at_16.36.00

How to set up and validate locally

Prerequisites:

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

E. IMPORTANT: Make sure that your setup is not simulating SAAS. You might want to run export GITLAB_SIMULATE_SAAS=0 before gdk start just to make sure.

Steps:

  1. In the GraphQL explorer, http://gdk.test:3000/-/graphql-explorer, give the following query. Replace 5 with the container repository ID that you have locally.
query {
  containerRepository(id: "gid://gitlab/ContainerRepository/5") {
    lastPublishedAt
  }
}
  1. For a container repository that had a tag pushed recently, lastPublishedAt would be filled up:
{
  "data": {
    "containerRepository": {
      "lastPublishedAt": "2024-06-27T08:24:15+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 🙏 Please also verify that you are logged in

  1. For a container repository that did not have a pushed tag, we expect lastPublishedAt to be null
{
  "data": {
    "containerRepository": {
      "lastPublishedAt": null
    }
  }
}

Related to #458820 (closed)

Edited by Adie (she/her)

Merge request reports

Loading