Skip to content

feat: s3 transfer manager v2 #3079

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

Open
wants to merge 53 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
3093732
feat: s3 transfer manager v2
yenfryherrerafeliz Feb 2, 2025
5950c31
chore: add tests cases and refactor
yenfryherrerafeliz Feb 6, 2025
1c82ab5
chore: add multipart download listener tests
yenfryherrerafeliz Feb 6, 2025
237fc7b
chore: refactor multipart downloaders and add tests
yenfryherrerafeliz Feb 6, 2025
c28c165
feat: add download directory and refactor code
yenfryherrerafeliz Feb 13, 2025
34321b2
chore: add upload and refactor code
yenfryherrerafeliz Feb 14, 2025
5289f7c
feat: add upload directory feature
yenfryherrerafeliz Feb 14, 2025
c6c0780
feat: multipart upload and some refactor
yenfryherrerafeliz Feb 17, 2025
034b50d
chore: short namespace
yenfryherrerafeliz Feb 17, 2025
bc15ac3
chore: refactor and address feedback
yenfryherrerafeliz Feb 22, 2025
e681d10
chore: fix test cases
yenfryherrerafeliz Feb 24, 2025
1f094cd
chore: remove unused implementation
yenfryherrerafeliz Feb 24, 2025
464b498
chore: remove invalid test
yenfryherrerafeliz Feb 24, 2025
09e493f
fix: add nullable type
yenfryherrerafeliz Feb 24, 2025
f10522b
chore: add more tests
yenfryherrerafeliz Feb 26, 2025
a55e1b3
chore: add upload unit tests and refactor
yenfryherrerafeliz Mar 13, 2025
b271897
chore: address naming feedback and test failures
yenfryherrerafeliz Mar 13, 2025
f4f1c88
chore: address minor styling issues
yenfryherrerafeliz Mar 13, 2025
d987aff
chore: add download tests
yenfryherrerafeliz Mar 17, 2025
6d000f1
chore: add integ tests
yenfryherrerafeliz May 19, 2025
27570d0
chore: add integ test
yenfryherrerafeliz May 20, 2025
1dde7fc
chore: address PR feedback
yenfryherrerafeliz May 26, 2025
060e0e1
chore: fix and refactor
yenfryherrerafeliz May 27, 2025
ee0fefb
chore: fix TransferListener import
yenfryherrerafeliz May 27, 2025
9f639f1
chore: add test case
yenfryherrerafeliz May 29, 2025
bdce369
chore: address PR feedback
yenfryherrerafeliz Jun 4, 2025
cd2133a
fix: prevent calling twice downloadFailed
yenfryherrerafeliz Jun 5, 2025
0426e11
chore: fix exception throwing
yenfryherrerafeliz Jun 5, 2025
a548ce2
feat: consider checksum mode from command
yenfryherrerafeliz Jun 17, 2025
5a25ad8
chore: tests and minor fixes
yenfryherrerafeliz Jun 18, 2025
64fc3f6
tests: Add integ test for abort
yenfryherrerafeliz Jun 18, 2025
908b4a0
chore: update integ test
yenfryherrerafeliz Jun 18, 2025
1e643e5
feat: update to use modeled inputs
yenfryherrerafeliz Jul 10, 2025
48a2822
chore: multipart download updates
yenfryherrerafeliz Jul 15, 2025
02b43f0
chore: s3 transfer manager updates
yenfryherrerafeliz Jul 17, 2025
153227b
chore: minor update
yenfryherrerafeliz Jul 17, 2025
31dbd19
chore: add empty lines at the end
yenfryherrerafeliz Jul 17, 2025
aeed758
chore: remove unused implementations
yenfryherrerafeliz Jul 17, 2025
26d2469
fix: object key should be normalized
yenfryherrerafeliz Jul 17, 2025
10928ca
fix: minor logic and test fix
yenfryherrerafeliz Jul 18, 2025
632ece9
fix: fix s3 delimiter test
yenfryherrerafeliz Jul 18, 2025
6efcc0a
fix: wrong data provider name used
yenfryherrerafeliz Jul 18, 2025
b0c5f75
chore: addressed some styling
yenfryherrerafeliz Jul 18, 2025
44f6ff4
chore: update argument name
yenfryherrerafeliz Jul 18, 2025
83ccd9b
chore: make config optional
yenfryherrerafeliz Jul 22, 2025
039a67b
chore: minor refactor and fix
yenfryherrerafeliz Jul 23, 2025
50715d1
chore: make parameter optional
yenfryherrerafeliz Jul 23, 2025
3034ad8
chore: make model classes final
yenfryherrerafeliz Jul 28, 2025
cfe4ab5
chore: make classes final and refactor tests
yenfryherrerafeliz Jul 29, 2025
f4c42e0
chore: fix and reformat integ test
yenfryherrerafeliz Jul 30, 2025
9fb03f1
chore: address some styling suggestions
yenfryherrerafeliz Jul 31, 2025
4268266
chore: address PR suggestions
yenfryherrerafeliz Aug 4, 2025
59a8aa4
chore: null as default
yenfryherrerafeliz Aug 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ default:
s3:
paths: [ "%paths.base%/features/s3" ]
contexts: [ Aws\Test\Integ\S3Context ]
s3TransferManager:
paths: [ "%paths.base%/features/s3Transfer" ]
contexts: [ Aws\Test\Integ\S3TransferManagerContext ]
s3Encryption:
paths: [ "%paths.base%/features/s3Encryption" ]
contexts: [ Aws\Test\Integ\S3EncryptionContext ]
Expand Down
117 changes: 117 additions & 0 deletions features/s3Transfer/s3TransferManager.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
@s3-transfer-manager @integ
Feature: S3 Transfer Manager
S3 Transfer Manager should successfully do:
- object uploads
- object multipart uploads
- object downloads
- object multipart downloads
- directory object uploads
- directory object downloads

Scenario Outline: Successfully does a single file upload
Given I have a file <filename> with content <content>
When I upload the file <filename> to a test bucket using the s3 transfer manager
Then the file <filename> should exist in the test bucket and its content should be <content>

Examples:
| filename | content |
| myfile-test-1-1.txt | Test content #1 |
| myfile-test-1-2.txt | Test content #2 |
| myfile-test-1-3.txt | Test content #3 |


Scenario Outline: Successfully does a single upload from a stream
Given I have a stream with content <content>
When I do the upload to a test bucket with key <key>
Then the object <key>, once downloaded from the test bucket, should match the content <content>
Examples:
| content | key |
| "This is a test text - 1" | myfile-test-2-1.txt |
| "This is a test text - 2" | myfile-test-2-2.txt |
| "This is a test text - 3" | myfile-test-2-3.txt |

Scenario Outline: Successfully do multipart object upload from file
Given I have a file with name <filename> where its content's size is <filesize>
When I do upload this file with name <filename> with the specified part size of <partsize>
Then the object with name <filename> should have a total of <partnum> parts and its size must be <filesize>
Examples:
| filename | filesize | partsize | partnum |
| myfile-test-3-1.txt | 10485760 | 5242880 | 2 |
| myfile-test-3-2.txt | 24117248 | 5242880 | 5 |
| myfile-test-3-3.txt | 24117248 | 8388608 | 3 |

Scenario Outline: Successfully do multipart object upload from streams
Given I want to upload a stream of size <filesize>
When I do upload this stream with name <filename> and the specified part size of <partsize>
Then the object with name <filename> should have a total of <partnum> parts and its size must be <filesize>
Examples:
| filename | filesize | partsize | partnum |
| myfile-test-4-1.txt | 10485760 | 5242880 | 2 |
| myfile-test-4-2.txt | 24117248 | 5242880 | 5 |
| myfile-test-4-3.txt | 24117248 | 8388608 | 3 |

Scenario Outline: Does single object upload with custom checksum
Given I have a file with name <filename> and its content is <content>
When I upload this file with name <filename> by providing a custom checksum algorithm <checksum_algorithm>
Then the checksum from the object with name <filename> should be equals to the calculation of the object content with the checksum algorithm <checksum_algorithm>
Examples:
| filename | content | checksum_algorithm |
| myfile-test-5-1.txt | This is a test file content #1 | crc32 |
| myfile-test-5-2.txt | This is a test file content #2 | crc32c |
| myfile-test-5-3.txt | This is a test file content #3 | sha256 |
| myfile-test-5-4.txt | This is a test file content #4 | sha1 |

Scenario Outline: Does single object download
Given I have an object in S3 with name <filename> and its content is <content>
When I do a download of the object with name <filename>
Then the object with name <filename> should have been downloaded and its content should be <content>
Examples:
| filename | content |
| myfile-test-6-1.txt | This is a test file content #1 |
| myfile-test-6-2.txt | This is a test file content #2 |
| myfile-test-6-3.txt | This is a test file content #3 |

Scenario Outline: Successfully does multipart object download
Given I have an object in S3 with name <filename> and its size is <filesize>
When I download the object with name <filename> by using the <download_type> multipart download type
Then the content size for the object with name <filename> should be <filesize>
Examples:
| filename | filesize | download_type |
| myfile-test-7-1.txt | 20971520 | ranged |
| myfile-test-7-2.txt | 28311552 | ranged |
| myfile-test-7-3.txt | 12582912 | ranged |
| myfile-test-7-4.txt | 20971520 | part |
| myfile-test-7-5.txt | 28311552 | part |
| myfile-test-7-6.txt | 12582912 | part |

Scenario Outline: Successfully does directory upload
Given I have a directory <directory> with <numfile> files that I want to upload
When I upload this directory <directory>
Then the files from this directory <directory> where its count should be <numfile> should exist in the bucket
Examples:
| directory | numfile |
| directory-test-1-1 | 10 |
| directory-test-1-2 | 3 |
| directory-test-1-3 | 25 |
| directory-test-1-4 | 1 |

Scenario Outline: Successfully does a directory download
Given I have a total of <numfile> objects in a bucket prefixed with <directory>
When I download all of them into the directory <directory>
Then the objects <numfile> should exist as files within the directory <directory>
Examples:
| numfile | directory |
| 15 | directory-test-2-1 |
| 12 | directory-test-2-2 |
| 1 | directory-test-2-3 |
| 30 | directory-test-2-4 |

Scenario Outline: Abort a multipart upload
Given I am uploading the file <file> with size <size>
When I upload the file <file> using multipart upload and fails at part number <partNumberFail>
Then The multipart upload should have been aborted for file <file>
Examples:
| file | size | partNumberFail |
| abort-file-1.txt | 20971520 | 3 |
| abort-file-2.txt | 41943040 | 5 |
| abort-file-3.txt | 10485760 | 1 |
3 changes: 2 additions & 1 deletion src/S3/ApplyChecksumMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ public function __invoke(
$name = $command->getName();
$body = $request->getBody();
$operation = $this->api->getOperation($name);
$mode = $this->config['request_checksum_calculation']
$mode = $command['@context']['request_checksum_calculation']
?? $this->config['request_checksum_calculation']
?? self::DEFAULT_CALCULATION_MODE;

// Trigger warning if AddContentMD5 is specified for PutObject or UploadPart
Expand Down
Loading