Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

peterbud
Copy link

@peterbud peterbud commented Jan 4, 2025

This PR adds raw item get/set support, similar to abandoned #442, but also adds test for that new procedures.

Also I have noticed that the current removeItem test fails, as delete operation with non-existent keys leads to an error. I assume the intention is not to fail in such cases, so I have not changed the removeItem test, but added a check before attempting to delete the blob at the Azure Blob driver.

Copy link

codecov bot commented Jan 4, 2025

Codecov Report

Attention: Patch coverage is 7.14286% with 26 lines in your changes missing coverage. Please review.

Project coverage is 59.63%. Comparing base (4d61c78) to head (5a56d23).
Report is 160 commits behind head on main.

Files with missing lines Patch % Lines
src/drivers/azure-storage-blob.ts 7.14% 26 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #565      +/-   ##
==========================================
- Coverage   65.05%   59.63%   -5.43%     
==========================================
  Files          39       42       +3     
  Lines        4055     3676     -379     
  Branches      487      590     +103     
==========================================
- Hits         2638     2192     -446     
- Misses       1408     1481      +73     
+ Partials        9        3       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@itpropro
Copy link
Member

itpropro commented Jan 6, 2025

Thanks for bringing this up again, I unfortunately missed the PR.
Let me go over the tests to validate we are fine here so we can proceed as soon as possible.

@peterbud
Copy link
Author

Hi @itpropro , is there any update on your review please?

@itpropro itpropro requested a review from pi0 as a code owner January 28, 2025 20:38
@itpropro
Copy link
Member

itpropro commented Jan 29, 2025

Hi @itpropro , is there any update on your review please?

Hey,
I added some additions to improve test coverage. Thanks for also fixing the removeItem inconsistency. Can you explain what the "properly encodes raw items" test covers that is not already covered by the "raw support" test in the test suite?
If it covers the same as the internal test, I don't think it's necessary.
After that we are good to go from my perspective, I tested the current code against Azurite and an online instance of a storage account.

@pi0 do you thinks it's better to check for the item first and only then delete or to just catch a failed delete to nowhere? I would prefer to silently catch for performance reasons.

@peterbud
Copy link
Author

Can you explain what the "properly encodes raw items" test covers that is not already covered by the "raw support" test in the test suite?

I did not know that there is a default raw support test. I have seen that the fs driver has a raw items test, and I assumed this had to be added for drivers which implement these additional methods.

If not needed, then let's remove this test!

@itpropro
Copy link
Member

No problem, all drivers use the testDriver test suite as a baseline. That one has a rawItem test here

it("raw support", async () => {
.

@itpropro
Copy link
Member

I removed the redundant test. Should I extract the additional added tests to a separate PR @pi0 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants