Fix 500 errors when renaming projects with underscores
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68357 added the `container_registry_migration_phase1` feature flag. When enabled, this change caused a `ContainerRepository` model to be instantiated every time the registry client checked for tags. For projects that had trailing/leading underscores in their paths, this would trigger a validation error and cause a `ContainerRegistry::Path::InvalidRegistryPathError` exception to be raised while trying to generate the `migration_eligible` flag in the access token. Previously this would not cause a 500 error because the access token was still generated, but the manifest would return empty since registry images cannot exist for project paths with trailing/leading underscores. To preserve the previous behavior, we now catch and log this exception in `ContainerRegistryAuthenticationService.migration_eligible`. Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/27483 Changelog: fixed
Showing
Please register or sign in to comment