Skip to content

Check if Gitlab API is supported when using sub-repositories endpoint

Adie (she/her) requested to merge 388537-check-gitlab-supported into master

What does this MR do and why?

Part of #388537 (closed).

In !110664 (merged), we added the use of the new sub-repositories endpoint behind a feature flag.

From discussions and investigations such as in https://gitlab.com/gitlab-org/gitlab/-/issues/360664#note_1298806539, it seems that instead of just checking for Gitlab.com?, we should also check ContainerRegistry::GitlabApiClient.supports_gitlab_api? (where Gitlab.com is already checked).

How to set up and validate locally

When calling Namespace#first_project_with_container_registry_tags, if ContainerRegistry::GitlabApiClient.supports_gitlab_api? is true then the new sub-repositories endpoint should be called, otherwise the existing query is called.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #388537 (closed)

Edited by Adie (she/her)

Merge request reports

Loading