Skip to content

Validate snippet repos when restoring

Vijay Hawoldar requested to merge vij-snippet-restore-validation into master

What does this MR do?

When GitLab restoring from a backup, we must validate any snippet repositories that get restored.

This MR achieves that by using Snippets::RepositoryValidationService for each snippet repository that is restored. If it is not valid, that Snippet restoration will cancelled and:

  • an error log will be output for that snippet
  • the snippet will be removed from the DB
  • any associated SnippetRepository will be removed from the DB
  • any repository for that snippet will be removed

In order to ensure we don't encounter any problems by removing snippets during a find_each batch process, or when processing in multiple threads, we will remove all snippets without a repository after the restore iterations have completed.

I haven't added a changelog entry as part of this MR because one was added in the original MR within the same release, here: !43696 (merged)

Refs #266944 (closed)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Peter Leitzen

Merge request reports