unstorage icon indicating copy to clipboard operation
unstorage copied to clipboard

feat(azure-storage-blob): add raw support

Open blowsie opened this issue 1 year ago โ€ข 5 comments

๐Ÿ”— Linked issue

#441

โ“ Type of change

  • [ ] ๐Ÿ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • [ ] ๐Ÿž Bug fix (a non-breaking change that fixes an issue)
  • [ ] ๐Ÿ‘Œ Enhancement (improving an existing functionality like performance)
  • [x] โœจ New feature (a non-breaking change that adds functionality)
  • [ ] ๐Ÿงน Chore (updates to the build process or auxiliary tools and libraries)
  • [ ] โš ๏ธ Breaking change (fix or feature that would cause existing functionality to change)

๐Ÿ“š Description

Adds support for getItemRaw in azure-storage-blob

๐Ÿ“ Checklist

  • [x] I have linked an issue or discussion.
  • [ ] I have updated the documentation accordingly.

Functions are not documented

blowsie avatar May 08 '24 16:05 blowsie

Thanks for PR!

  • I think most of get/raw logic can now be shared using a function and we call toString for not raw version
  • We need to also implement the setItemRaw method otherwise core will stringify when setting but not deserialize in getRaw
  • Can you help to add an additional test to driver test that covers this? (/cc @itpropro he might be able to help ๐Ÿ™๐Ÿผ )

pi0 avatar May 08 '24 16:05 pi0

Codecov Report

Attention: Patch coverage is 6.66667% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 66.33%. Comparing base (4d61c78) to head (a2112b4). Report is 41 commits behind head on main.

Files Patch % Lines
src/drivers/azure-storage-blob.ts 6.66% 14 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #442      +/-   ##
==========================================
+ Coverage   65.05%   66.33%   +1.27%     
==========================================
  Files          39       39              
  Lines        4055     4117      +62     
  Branches      487      509      +22     
==========================================
+ Hits         2638     2731      +93     
+ Misses       1408     1377      -31     
  Partials        9        9              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 08 '24 16:05 codecov[bot]

Thanks for PR!

  • I think most of get/raw logic can now be shared using a function and we call toString for not raw version

I wasn't sure about extracting and reusing the fn, since when I reviewed all the other getItemRaw implementations there is no re-use. For this reason, I tried to copy the existing style.

  • We need to also implement the setItemRaw method otherwise core will stringify when setting but not deserialize in getRaw

I unfortunately don't know enough about how to do that, but can do some digging at some point if it helps.

  • Can you help to add an additional test to driver test that covers this? (/cc @itpropro he might be able to help ๐Ÿ™๐Ÿผ )

Adding tests, would be a separate issue and not a blocker for this change, right?

blowsie avatar May 08 '24 16:05 blowsie

For setItemRaw, it seems that our driver implementation will be the same. But we need to set it. see here for what happens.

Adding tests, would be a separate issue and not a blocker for this change, right?

Since this is a live driver with already tests, i prefer that we add a reasonable test that verifies this feature.

pi0 avatar May 08 '24 17:05 pi0

Hello team, is there any plans to complete this PR, or should I open a new one if I'd like to have this functionality?

peterbud avatar Jan 04 '25 09:01 peterbud

Merged via #565. Thanks for PR โค๏ธ

pi0 avatar Apr 27 '25 16:04 pi0