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

Minio : pass size argument #1489

Merged
merged 5 commits into from
Mar 5, 2025
Merged

Minio : pass size argument #1489

merged 5 commits into from
Mar 5, 2025

Conversation

vviers
Copy link
Collaborator

@vviers vviers commented Feb 28, 2025

Fixes #1488

Looking at the MinIO.js client's code for putObject, it looks like passing the size argument lets it be clever about whether to perform an upload in one part or as a multi-part.

I also threw some new comments in the codebase that were usefull to me when reading the code. Can revert or shove them in a separate PR if you'd prefer.

@paulfitz
Copy link
Member

@vviers passing size is a good improvement. The comments are welcome. Please ping when ready for review.

(ccing also @Spoffy since he is touching same interface in a parallel PR but everything looks compatible)

@vviers vviers marked this pull request as ready for review February 28, 2025 15:10
@vviers
Copy link
Collaborator Author

vviers commented Feb 28, 2025

@paulfitz @Spoffy an initial review would be helpful :)

I'm looking into adding tests but I'm not super familiar with the test codebase in grist, let alone testing in JS, so any pointer would be useful 🙂

@vviers
Copy link
Collaborator Author

vviers commented Feb 28, 2025

I tried to add the same behavior to the ExternalStorageAttachmentStore's upload method so that I could add a test here before realizing that there was no reliable way to know the size of the the readable stream coming in, duh 🙃

@vviers
Copy link
Collaborator Author

vviers commented Feb 28, 2025

I tried to add a test to https://github.com/gristlabs/grist-core/blob/main/test/server/lib/HostedStorageManager.ts and failed miserably, this JS code is a bit above my paygrade 😶 help appreciated here !

@vviers
Copy link
Collaborator Author

vviers commented Feb 28, 2025

I am fairly confident that the failed CI run is unrelated to my changes

@vviers vviers added the gouv.fr label Feb 28, 2025
Copy link
Collaborator

@fflorent fflorent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I wonder if whether should add tests after these changes.

@fflorent
Copy link
Collaborator

fflorent commented Mar 3, 2025

Ok, about the second comment, but what about the first one ?

@vviers
Copy link
Collaborator Author

vviers commented Mar 3, 2025

Ok, about the second comment, but what about the first one ?

Done ✅

Copy link
Member

@paulfitz paulfitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vviers ! I think existing tests cover this, I'd have expected failures if the introduction of size caused an issue.

@paulfitz paulfitz merged commit fdbf73b into gristlabs:main Mar 5, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

MinIO : disable multi-part upload for small files
3 participants