AssetSync / asset_sync

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

Add Backblaze B2 Cloud Storage #410

Closed duartemvix closed 3 years ago

duartemvix commented 3 years ago

This should add support for Backblaze B2 Cloud Storage to Asset Sync

PikachuEXE commented 3 years ago

Have you tested this with actual Backblaze B2?

duartemvix commented 3 years ago

Have you tested this with actual Backblaze B2?

Yes, I did. I'm already using it in my other repositories linkng to my own fork. This one on this PR.

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 478


Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/asset_sync/storage.rb 2 3 66.67%
lib/asset_sync/engine.rb 0 3 0.0%
lib/asset_sync/config.rb 7 11 63.64%
lib/generators/asset_sync/templates/asset_sync.rb 0 5 0.0%
lib/generators/asset_sync/install_generator.rb 0 13 0.0%
<!-- Total: 9 35 25.71% -->
Files with Coverage Reduction New Missed Lines %
lib/asset_sync/config.rb 1 92.15%
lib/asset_sync/engine.rb 1 0%
lib/asset_sync/storage.rb 1 72.63%
<!-- Total: 3 -->
Totals Coverage Status
Change from base Build 470: -2.3%
Covered Lines: 409
Relevant Lines: 644

💛 - Coveralls
PikachuEXE commented 3 years ago

There are some failed jobs if you look into Travis Can you fix it?

duartemvix commented 3 years ago

There are some failed jobs if you look into Travis Can you fix it?

At Travis, apparently it's failing on old Ruby versions. And as far as I've seen it I'm not sure what is really wrong. I can't seem to understand Coveralls too.

PikachuEXE commented 3 years ago

I think it's due to the double created not stubbing all the method calls https://github.com/AssetSync/asset_sync/blob/cc9d971f1288c851720e9c407e5152bc29b4b214/spec/unit/storage_spec.rb#L415-L442 In this case your updated code calls a new method backblaze? which is not stubbed Adding a line in that test case like

allow(config).to receive(:backblaze?).and_return(false)

should fix it

duartemvix commented 3 years ago

I think it's due to the double created not stubbing all the method calls https://github.com/AssetSync/asset_sync/blob/cc9d971f1288c851720e9c407e5152bc29b4b214/spec/unit/storage_spec.rb#L415-L442

In this case your updated code calls a new method backblaze? which is not stubbed Adding a line in that test case like

allow(config).to receive(:backblaze?).and_return(false)

should fix it

I missed that file. You're right, I'll push new changes right about now.

duartemvix commented 3 years ago

@PikachuEXE Have any idea on how to fix jobs that failed running on jruby?

PikachuEXE commented 3 years ago

Don't worry The "error" is

The job exceeded the maximum time limit for jobs, and has been terminated.

I will just ignore jruby result, probably all passed And this "error" is probably TravisCI issue

Merging next week otherwise I will forget to release (Too lazy to bring up my Mac on weekend...)

duartemvix commented 3 years ago

Don't worry The "error" is

The job exceeded the maximum time limit for jobs, and has been terminated.

I will just ignore jruby result, probably all passed And this "error" is probably TravisCI issue

Merging next week otherwise I will forget to release (Too lazy to bring up my Mac on weekend...)

Oh, okay! Great! Happy to help!

I'm also pushing some changes to the fog/fog-backblaze which in turn will make it more equal to its sisters fog-aws and fog-azurerm. That library needs some updates too but this PR should already make master work at a basic level with Backblaze B2.

PikachuEXE commented 3 years ago

I'm also pushing some changes to the fog/fog-backblaze

I am interested to know more

PikachuEXE commented 3 years ago

Released in 2.13.0