-
Notifications
You must be signed in to change notification settings - Fork 811
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mappping for non-HTTP config settings and add comments for settin…
…gs (#5181)
- Loading branch information
Showing
12 changed files
with
391 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 | ||
- 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 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 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.