Step 7: Version Control for Snippets: Run background migration (MVP)

In #39202 (closed) we implemented the background migration to backfill snippet repositories with the content stored in content and file_name columns.

The feature flag :version_snippets should be removed, otherwise, on-premise users won't be able to run it

The background migration can be something like:

 INTERVAL = 5.minutes.to_i
 BATCH_SIZE = 50 # we lower the number because the commit operations take longer
 MIGRATION = 'BackfillSnippetRepositories'

 Snippet.all.each_batch(of: BATCH_SIZE) do |batch, index|
   range = batch.pluck('MIN(id)', 'MAX(id)').first
   delay = index * INTERVAL
   BackgroundMigrationWorker.perform_in(delay, MIGRATION, *range)
 end

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Edited by 🤖 GitLab Bot 🤖