Hashed storage migration should not be attempted if project does not validate
We saw in https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/6022 that projects may not validate due a number of reasons:
Validation failed: Build timeout needs to be beetween 10 minutes and 1 monthValidation failed: Path has already been taken
We should check before doing any filesystem moves whether Project#validate passes in the first place. There's no sense in moving a project on the filesystem if the database entry can't be updated.
Alternatively, we could allow projects to update the repository version by bypassing the validation.
/cc: @brodock
Double check the following files are not making an update to the Project model that can trigger a validation:
-
app/services/projects/hashed_storage/migrate_attachments_service.rb -
app/services/projects/hashed_storage/migrate_repository_service.rb -
app/services/projects/hashed_storage/rollback_attachments_service.rb -
app/services/projects/hashed_storage/rollback_repository_service.rb
Edited by Gabriel Mazetto