Move `migrate!` method/logic into CarrierWave and ensure data integrity
Currently, we've pulled a lot of CarrierWave classes/logic for the
migrate! method. Also, we manually update
file_store out of CarrierWave routine. This gains the complexity of the whole migration processes and risks user data by human errors.
We can contain the whole logic in CarrierWave.
In addition, we can check if the uploaded data is truly same with the source by sending checksum to OS.
migrate!method into CarrierWave with
content-md5header when putting object to ObjectStorage (AWS/GCS)
- If no ETag value returned, raise
CarrierWave::IntegrityErrorand surface the error to the comsumer (i.e. GitLab-rails)
- Mitigating the whole complexity
- Maintainable and scalable approach
- Tested/Reviewed by contributors and CarrierWave users