Skip to content

[container registry migration] Remove backend related code

🔥 Problem

During the container registry migration, rails was the main driver of the migration. Several changes went into the code to handle the migration.

That phase is now completed on gitlab.com and self-managed will use a different migration path.

As such, the code related to the container registry migration is not used anymore and can be removed.

🚒 Solution

Several things need to be removed/cleanup. Several MRs will be needed.

Also, several milestones are needed.

1️⃣ Background jobs (DONE 100%)

  • Remove all 3 jobs that are in app/workers/container_registry/migration/.
  • Remove the related specs.

2️⃣ API endpoints (DONE 100%)

  • Remove API::Internal::ContainerRegistry::Migration

3️⃣ Database (17.0: , 17.1: , 17.2: , 17.3: PENDING)

On container_repositories table, remove columns:

  • remove all migration_* columns.

4️⃣ Model

  • In ContainerRepository mode, remove
    • scopes related to the migration.
    • remove the state machine.
    • remove all helper functions.
    • remove related functions.

5️⃣ Gitlab Settings (17.0: , 17.1: , 17.2, )

Remove the settings from ApplicationSettings:

 :container_registry_import_max_tags_count
 :container_registry_import_max_retries
 :container_registry_import_start_max_retries
 :container_registry_import_max_step_duration
 :container_registry_import_target_plan
 :container_registry_import_created_before
 :container_registry_pre_import_timeout
 :container_registry_import_timeout
 :container_registry_pre_import_tags_rate

A related MR in !149168 (merged).

6️⃣ Cleanup import API calls in lib/container_registry/gitlab_api_client.rb (DONE 100%)

Remove all calls to the registry migration API. This in turn should also allow the removal of the import_access token in the container registry auth service.

Edited by Adie (she/her)