fix S3 parser with empty integer query string parameters #9603
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
When scrolling over my GitHub homepage, I stumbled upon this (edit: apparently dead) library: https://github.com/beyondstorage/go-storage
(Story: https://xuanwo.io/en-us/2023/01-beyond-storage-why-we-failed/, all commits are from dependabot now 😅 and it seems OpenDAL (repo) is superseding the project, I've ran their Rust test suite (106 tests!) and it's all green 🎉)
It seems it's has been sponsored by Vercel, and I saw they had coverage for S3, and an automated in CI integration test suite.
I've forked the repo and ran the suite locally with LocalStack 😄 I saw they had support for minio too.
I've ran it locally and found only one test failure:
With the following trace:
I've checked the request we received:
So it seems S3 accepts empty query string parameters that are of
integer
type in the specs.After fixing the issue, here's the test result (87 successful tests!):
Test Results
$ make integration_test
I'll validate the pre-signed requests, for now they pass because we disable validations but I believe they would fail and I'll need to investigate.
Changes
xfail
: it does not take a callable as input and will treat it asTrue
, unlikeskip_snapshot_verify
Testing
You can also run the test suite by cloning the repo, navigating to
./services/s3
and for ease set anMakefile.env
with the following:Start LocalStack, run
awslocal s3 mb s3://test
to create the test bucket.Then you can run
make integration_test
and see it go ✅For the OpenDAL test suite, you need to checkout: https://github.com/apache/incubator-opendal
Then navigate to
core
.Run
awslocal s3 mb s3://opendal-testing
(Install
cargo-nextest
if you don't have it: https://nexte.st/book/pre-built-binaries.html)Create and load the following
.env
file:Run
cargo nextest run behavior --features tests
And see the following:
OpenDAL Results