fix(cli): handle unsupported S3 acceleration in migration#14900
Open
hariharan077 wants to merge 1 commit into
Open
fix(cli): handle unsupported S3 acceleration in migration#14900hariharan077 wants to merge 1 commit into
hariharan077 wants to merge 1 commit into
Conversation
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of changes
Fixes #14876.
amplify gen2-migration generatecurrently fails when S3 returnsMethodNotAllowedforGetBucketAccelerateConfiguration, which can happen for buckets in regions where transfer acceleration is unsupported. This updatesAwsFetcher.fetchBucketAccelerate()to treat onlyMethodNotAllowedas an unavailable/disabled acceleration state and returnundefined, while still propagating other S3 errors.Also adds focused coverage for:
undefinedforMethodNotAllowedMethodNotAllowedfailuresDescription of how you validated changes
MethodNotAllowedcase rejected instead of resolving toundefined.corepack yarn workspace @aws-amplify/cli-internal test src/__tests__/commands/gen2-migration/_common/aws-fetcher.test.ts --runInBand --no-coveragecorepack yarn workspace @aws-amplify/cli-internal test src/__tests__/commands/gen2-migration/generate/amplify/storage/s3.generator.test.ts --runInBand --no-coveragecorepack yarn prettier --check packages/amplify-cli/src/commands/gen2-migration/_common/aws-fetcher.ts packages/amplify-cli/src/__tests__/commands/gen2-migration/_common/aws-fetcher.test.tscorepack yarn eslint packages/amplify-cli/src/commands/gen2-migration/_common/aws-fetcher.ts packages/amplify-cli/src/__tests__/commands/gen2-migration/_common/aws-fetcher.test.ts --max-warnings=1500Note: local git hooks call a
yarnbinary directly, while this environment only exposes Yarn through Corepack, so commit/push hooks were bypassed after running the focused checks above manually.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.