Skip to content

Fix snippet migration when user has invalid info

What does this MR do?

When the user has an invalid name or email (or they're empty), for example a name like ., git commit operations fail. This failure is raised by libgit2 not the Rails or Gitaly code. Therefore, there is no way to capture the error beforehand.

Therefore, once this error is raised we need to use a different user to perform the snippet migration commit, a more reliable one. This user will be the migration_bot.

At the moment, the migration retries the migration twice per each snippet. Nevertheless, there is an edge case we should consider. This scenario is when the snippet file_name is invalid and also the snippet author has an invalid email or name. In this case, we need to iterate three times. The first one to change the path. The second one to change the user. And the last one to perform the successful commit.

Does this MR meet the acceptance criteria?

Conformity

Edited by 🤖 GitLab Bot 🤖

Merge request reports