Skip to content

Commit

Permalink
[Chore] Enable Integ test and tagged release on Multi-bucket work (aw…
Browse files Browse the repository at this point in the history
  • Loading branch information
ashika112 committed Jul 19, 2024
1 parent b9cfe68 commit 043d913
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push-preid-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
push:
branches:
# Change this to your branch name where "example-preid" corresponds to the preid you want your changes released on
- feat/example-preid-branch/main
- feat/multi-bucket

jobs:
e2e:
Expand Down
21 changes: 12 additions & 9 deletions packages/storage/src/providers/s3/apis/internal/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@ const isCopyInputWithPath = (
const storageBucketAssertion = (
sourceBucket?: StorageBucket,
destBucket?: StorageBucket,
) =>
// Throw assertion error when either one of bucket options is empty
{
assertValidationError(
(sourceBucket !== undefined && destBucket !== undefined) ||
(!destBucket && !sourceBucket),
StorageValidationErrorCode.InvalidCopyOperationStorageBucket,
);
};
) => {
/** For multi-bucket, both source and destination bucket needs to be passed in
* or both can be undefined and we fallback to singleton's default value
*/
assertValidationError(
// Both src & dest bucket option is present is acceptable
(sourceBucket !== undefined && destBucket !== undefined) ||
// or both are undefined is also acceptable
(!destBucket && !sourceBucket),
StorageValidationErrorCode.InvalidCopyOperationStorageBucket,
);
};

export const copy = async (
amplify: AmplifyClassV6,
Expand Down

0 comments on commit 043d913

Please sign in to comment.