AssetSync / asset_sync

Synchronises Assets between Rails and S3
1.88k stars 346 forks source link

Compression raises an error in 2.19.0 #436

Closed wata727 closed 11 months ago

wata727 commented 11 months ago

When I tried 2.19.0, the following error occurred in our deployment pipeline.

        elsif File.exist?(compressed)
                          ^^^^^^^^^^
Did you mean?  compressed_size
/app/vendor/bundle/ruby/3.1.0/gems/asset_sync-2.19.0/lib/asset_sync/storage.rb:272:in `upload_file'
/app/vendor/bundle/ruby/3.1.0/gems/asset_sync-2.19.0/lib/asset_sync/storage.rb:342:in `block in upload_files'
/app/vendor/bundle/ruby/3.1.0/gems/asset_sync-2.19.0/lib/asset_sync/storage.rb:341:in `each'
/app/vendor/bundle/ruby/3.1.0/gems/asset_sync-2.19.0/lib/asset_sync/storage.rb:341:in `upload_files'
/app/vendor/bundle/ruby/3.1.0/gems/asset_sync-2.19.0/lib/asset_sync/storage.rb:360:in `sync'
/app/vendor/bundle/ruby/3.1.0/gems/asset_sync-2.19.0/lib/asset_sync/asset_sync.rb:31:in `block in sync'
/app/vendor/bundle/ruby/3.1.0/gems/asset_sync-2.19.0/lib/asset_sync/asset_sync.rb:53:in `with_config'
/app/vendor/bundle/ruby/3.1.0/gems/asset_sync-2.19.0/lib/asset_sync/asset_sync.rb:30:in `sync'
/app/vendor/bundle/ruby/3.1.0/gems/asset_sync-2.19.0/lib/tasks/asset_sync.rake:5:in `block (2 levels) in <main>'

Probably due to the change in https://github.com/AssetSync/asset_sync/pull/435.

PikachuEXE commented 11 months ago

Made a fix in https://github.com/AssetSync/asset_sync/commit/35bef657e9c65268e4888d489950184b238ba13f Could you help me see if that works?

That part of code is not auto tested (not sure how to do it...)

wata727 commented 11 months ago

Thank you for the quick fix! I confirmed that this patch works fine.

That part of code is not auto tested (not sure how to do it...)

Yeah, this seems like a bit of a tricky part to test. I'll think about it later to see if there's a better way.

Feel free to close this issue at your convenience. Thank you again for maintaining this gem.

UPDATE: This case is covered by tests added in https://github.com/AssetSync/asset_sync/pull/437

PikachuEXE commented 11 months ago

https://github.com/AssetSync/asset_sync/pull/437 is merged