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(storage): multi bucket download file api #5656

Merged
merged 16 commits into from
Nov 12, 2024

Conversation

ekjotmultani
Copy link
Member

Description of changes:

added integration tests
Updated download file options to accept bucket parameter

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ekjotmultani ekjotmultani force-pushed the feat/multi-bucket-download-file branch from c23fc64 to cf85cf1 Compare November 6, 2024 22:43
@ekjotmultani ekjotmultani marked this pull request as ready for review November 6, 2024 22:48
@ekjotmultani ekjotmultani requested a review from a team as a code owner November 6, 2024 22:48
Copy link
Member

@Equartey Equartey left a comment

Choose a reason for hiding this comment

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

LGTM. Are there any unit test that should be updated too?

@ekjotmultani
Copy link
Member Author

there don't seem to be any unit tests since this api actually just further calls the downloadData api so those tests suffice

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to duplicate all the test cases for the secondary bucket. we just need to tests that we can download a file usign bucket option.

Copy link
Member Author

Choose a reason for hiding this comment

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

This makes sense, I'll make a few separate ones under the standard config to test this then

@@ -216,15 +216,15 @@ class AmplifyStorageS3Dart extends StoragePluginInterface
defaultPluginOptions: const S3DownloadDataPluginOptions(),
);

final s3Options = StorageDownloadDataOptions(
options = StorageDownloadDataOptions(
Copy link
Member

Choose a reason for hiding this comment

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

Q: why to remove final?

Copy link
Member Author

Choose a reason for hiding this comment

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

it causes errors like "Local variable 'options' can't be referenced before it is declared." for using options?.bucket in the constructor, and another complaint of The final variable 'options' can't be read because it's potentially unassigned at this point.

Copy link
Member

Choose a reason for hiding this comment

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

how come it was final before? why to need to change it?

Copy link
Member Author

Choose a reason for hiding this comment

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

it was final before since it was called s3Options, different variable name than the one that is passed into the function as a parameter as well

Copy link
Member

Choose a reason for hiding this comment

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

I see the issue here, it is overriding the function input parameter and it is wrong to do so. Why to need to make this change? I would suggest to reveret it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did it to maintain consistency with the other functions options being called just options instead of s3options. I will revert it, I need to rebase with the most recent push to multi-bucket anyways

@ekjotmultani ekjotmultani merged commit 65ba15e into multi-bucket Nov 12, 2024
155 checks passed
@ekjotmultani ekjotmultani deleted the feat/multi-bucket-download-file branch November 12, 2024 22:09
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.

3 participants