Skip to content

Conversation

davidh44
Copy link
Contributor

Motivation and Context

There are a handful of POJOs in v1 that map to two types in v2. For instance, v1 AccessControlList is used as input to setObjectAcl(), and also returned as response from getObjectAcl().

In v2, AccessControlPolicy is used as input, while GetObjectAclResponse is returned as the response.

Modifications

Forked ChangeMethodInvocationReturnType recipe from OpenRewrite. It is a newer recipe so requires OR version bump, which introduces breaking changes with existing SDK recipes.

https://github.com/openrewrite/rewrite/blob/main/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodInvocationReturnType.java

Using this recipe to correctly change response types based on the method, returning the following responses:

GetObjectResponse
GetBucketAclResponse
GetObjectAclResponse
GetBucketAccelerateConfigurationResponse
GetBucketLifecycleConfigurationResponse
GetBucketCorsResponse
GetBucketLoggingResponse
GetBucketNotificationConfigurationResponse
GetBucketPolicyResponse
GetBucketReplicationResponse
GetBucketTaggingResponse
GetBucketVersioningResponse
GetBucketWebsiteResponse

Additional changes:

  • Map AmazonS3Exception to S3Exception
  • Map BucketLoggingConfiguration to BucketLoggingStatus
  • Revert converting CannedAccessControlList to ObjectCannedACL
    • We will leave as v1 POJO, and add comments in follow up PR to tell users to manually change to the appropriate v2 enum based on the method used, i.e. BucketCannedACL or ObjectCannedACL
  • Replace BucketName with Bucket in getter methods (already in place for setters)
  • Transform getBucketLocation() to append locationConstraint().toString() as v1 returns the String region

Testing

Added end to end tests

@davidh44 davidh44 requested a review from a team as a code owner April 10, 2025 22:56
@davidh44 davidh44 enabled auto-merge April 14, 2025 23:36
@davidh44 davidh44 added this pull request to the merge queue Apr 15, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 15, 2025
@davidh44 davidh44 added this pull request to the merge queue Apr 15, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 15, 2025
@davidh44 davidh44 added this pull request to the merge queue Apr 15, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Apr 15, 2025
@davidh44 davidh44 enabled auto-merge April 15, 2025 20:26
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

@davidh44 davidh44 added this pull request to the merge queue Apr 15, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 16, 2025
@davidh44 davidh44 added this pull request to the merge queue Apr 16, 2025
Merged via the queue into master with commit 449da7e Apr 16, 2025
29 of 31 checks passed
@davidh44 davidh44 deleted the hdavidh/migration-tool-change-response-types branch April 24, 2025 16:28
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