Skip to content

Conversation

davidh44
Copy link
Contributor

Motivation and Context

Transform v1 AmazonS3URI to v2 S3Uri

https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/migration-s3-uri-parser.html

Modifications

new recipe S3UriToV2

Testing

added end to end testing

@davidh44 davidh44 requested a review from a team as a code owner March 25, 2025 23:00
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

String region = s3Uri.region().map(Region::id).orElse(null);
boolean isPathStyle = s3Uri.isPathStyle();

S3Uri s3UriFromString = /*AWS SDK for Java v2 migration: v2 S3Uri does not URL-encode a String URI. If you relied on this functionality in v1 you must update your code to manually encode the String.*/S3Utilities.builder().build().parseUri(URI.create(uriAsString));
Copy link
Contributor

Choose a reason for hiding this comment

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

the Comment is kind of in a weird spot, is that what we do elsewhere for similar warning in migration tool?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah Dongie had same concern. We can't maintain the spacing if put on separate line though. Also for this specific transform can't do it on the line before since we transform the left and right hand sides separately. We could possibly do it on the next line. On the other hand, having it here makes it really obvious to the user

We do the same for other comments fwiw
https://github.com/aws/aws-sdk-java-v2/blob/master/v2-migration/src/test/java/software/amazon/awssdk/v2migration/AddCommentToMethodTest.java#L51

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it's great that it is really obvious, just a bit weird. I don't mind it.

@davidh44 davidh44 added this pull request to the merge queue Mar 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 26, 2025
@davidh44 davidh44 added this pull request to the merge queue Mar 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 26, 2025
@davidh44 davidh44 added this pull request to the merge queue Mar 26, 2025
Merged via the queue into master with commit 4089dca Mar 27, 2025
26 of 27 checks passed
@davidh44 davidh44 deleted the hdavidh/migration-tool-s3-uri branch March 27, 2025 01:48
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.

2 participants