-
Notifications
You must be signed in to change notification settings - Fork 915
Add mappping for non-HTTP config settings #5181
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
Merged
zoewangg
merged 1 commit into
feature/master/migration-tool
from
zoewang/migration-clientConfig-part2
May 7, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
132 changes: 132 additions & 0 deletions
132
migration-tool/src/main/resources/META-INF/rewrite/change-config-types.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"). | ||
# You may not use this file except in compliance with the License. | ||
# A copy of the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0 | ||
# | ||
# or in the "license" file accompanying this file. This file is distributed | ||
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
# express or implied. See the License for the specific language governing | ||
# permissions and limitations under the License. | ||
# | ||
## TODO: support retry policy, signer and throttledRetries | ||
--- | ||
type: specs.openrewrite.org/v1beta/recipe | ||
name: software.amazon.awssdk.ChangeConfigTypes | ||
displayName: Change region related classes | ||
recipeList: | ||
- org.openrewrite.java.ChangeMethodName: | ||
methodPattern: com.amazonaws.ClientConfiguration withRequestTimeout(int) | ||
newMethodName: withApiCallAttemptTimeout | ||
- org.openrewrite.java.ChangeMethodName: | ||
methodPattern: com.amazonaws.ClientConfiguration setRequestTimeout(int) | ||
newMethodName: withApiCallAttemptTimeout | ||
- software.amazon.awssdk.migration.internal.recipe.NumberToDuration: | ||
methodPattern: com.amazonaws.ClientConfiguration withApiCallAttemptTimeout(int) | ||
|
||
- org.openrewrite.java.ChangeMethodName: | ||
methodPattern: com.amazonaws.ClientConfiguration withClientExecutionTimeout(int) | ||
newMethodName: withApiCallTimeout | ||
- org.openrewrite.java.ChangeMethodName: | ||
methodPattern: com.amazonaws.ClientConfiguration setClientExecutionTimeout(int) | ||
newMethodName: withApiCallTimeout | ||
- software.amazon.awssdk.migration.internal.recipe.NumberToDuration: | ||
methodPattern: com.amazonaws.ClientConfiguration withApiCallTimeout(int) | ||
|
||
- org.openrewrite.java.ChangeMethodName: | ||
methodPattern: com.amazonaws.ClientConfiguration withRetryMode(..) | ||
newMethodName: withRetryPolicy | ||
- org.openrewrite.java.ChangeMethodName: | ||
methodPattern: com.amazonaws.ClientConfiguration setRetryMode(..) | ||
newMethodName: withRetryPolicy | ||
- org.openrewrite.java.ChangeMethodName: | ||
methodPattern: com.amazonaws.ClientConfiguration withHeader(String, String) | ||
newMethodName: withPutHeader | ||
- org.openrewrite.java.ChangeMethodName: | ||
methodPattern: com.amazonaws.ClientConfiguration setHeader(String, String) | ||
newMethodName: withPutHeader | ||
|
||
## Add comment to unsupported options | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! |
||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration setMaxConsecutiveRetriesBeforeThrottling(int) | ||
comment: maxConsecutiveRetriesBeforeThrottling is deprecated and not supported in v2. Consider removing it or using a custom RetryPolicy. | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration withMaxConsecutiveRetriesBeforeThrottling(int) | ||
comment: maxConsecutiveRetriesBeforeThrottling is deprecated and not supported in v2. Consider removing it or using a custom RetryPolicy. | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration setCacheResponseMetadata(boolean) | ||
comment: cacheResponseMetadata is deprecated and not supported in v2. Consider removing it. | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration withCacheResponseMetadata(boolean) | ||
comment: cacheResponseMetadata is deprecated and not supported in v2. Consider removing it. | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration withDisableHostPrefixInjection(boolean) | ||
comment: disableHostPrefixInjection is deprecated and not supported removed in v2. Consider removing it. | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration setDisableHostPrefixInjection(boolean) | ||
comment: disableHostPrefixInjection is deprecated and not supported in v2. Consider removing it. | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration setDnsResolver(..) | ||
comment: dnsResolver is not supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration withDnsResolver(..) | ||
comment: dnsResolver is not supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration setGzip(boolean) | ||
comment: gzip is not supported in v2 tracking in https://github.com/aws/aws-sdk-java-v2/issues/866. Consider removing it. | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration withGzip(boolean) | ||
comment: gzip is not supported in v2 tracking in https://github.com/aws/aws-sdk-java-v2/issues/866. Consider removing it. | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration setLocalAddress(..) | ||
comment: localAddress is not supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration withLocalAddress(..) | ||
comment: localAddress is not supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration setSecureRandom(.*) | ||
comment: secureRandom is not supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration withSecureRandom(.*) | ||
comment: secureRandom is supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration setUseExpectContinue(boolean) | ||
comment: useExpectContinue is removed in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration withUseExpectContinue(boolean) | ||
comment: useExpectContinue is removed in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration withProtocol(.*) | ||
comment: protocol is deprecated and not supported in v2. Consider using endpointOverride to specify HTTP scheme. | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration setProtocol(.*) | ||
comment: protocol is deprecated and not supported in v2. Consider using endpointOverride to specify HTTP scheme. | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration withUserAgent(String) | ||
comment: userAgent override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName). | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration setUserAgent(String) | ||
comment: userAgent override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName). | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration withUserAgentPrefix(String) | ||
comment: userAgentPrefix override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName). | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration setUserAgentPrefix(String) | ||
comment: userAgentPrefix override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName). | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration withUserAgentSuffix(String) | ||
comment: userAgentSuffix override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName). | ||
- software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod: | ||
methodPattern: com.amazonaws.ClientConfiguration setUserAgentSuffix(String) | ||
comment: userAgentSuffix override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName). | ||
|
||
## The following change needs to be the last step | ||
- org.openrewrite.java.ChangeType: | ||
oldFullyQualifiedTypeName: com.amazonaws.ClientConfiguration | ||
newFullyQualifiedTypeName: software.amazon.awssdk.core.client.config.ClientOverrideConfiguration | ||
- org.openrewrite.java.ChangeType: | ||
oldFullyQualifiedTypeName: com.amazonaws.retry.RetryMode | ||
newFullyQualifiedTypeName: software.amazon.awssdk.core.retry.RetryMode |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the other settings included in the scope for the preview version, or will they come later? Is there an approximate estimate for the size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They will not be included in the preview version. It's not trivial to implement them, probably x-large since we don't have anything similar implemented at the moment. It may become easier as we go. We can prioritize them based on feedback when we get to it.