Skip to content

Handle 404 responses from the container registry import status API

Jaime Martinez requested to merge 356085-handle-response-from-registry-api into master

🌻 Context

We're currently running a Container Registry data migration. We're not going to enter the details of that migration but the essential thing to know here is that the rails backend will drive it (eg. start the migration process on image repositories).

Among the logic used by the rails backend, we have a function that simply get the migration status (migration is a multi step process) from the container registry.

The problem is that this function doesn't handle non successful response codes, such as 404. This led to #356085 (closed).

As part of the resolution, the fix that this MR implements is updating the function to handle non successful response codes. When that happens, return the status 'pre_import_failed'. That status will trigger a retry. That's issue #356085 (closed).

Last piece of context: the whole migration is gated behind feature flag. It is not enabled on gitlab.com. This issue was discovered during staging testing.

🔬 What does this MR do and why?

  • Update the api client to handle non successful response codes in the #import_status function.
  • Update the related spec.

📷 Screenshots or screen recordings

n / a

📏 How to set up and validate locally

It's pretty involved to have all the necessary pieces locally (a container registry with the metadata database).

Given that this part is still in verification on staging, we're leaving this section empty as this part will be heavily tested as part of our staging verification.

Again, this changes of this MR will not be enabled on gitlab.com or self-managed users.

🛃 MR acceptance checklist

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

Edited by David Fernandez

Merge request reports