Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preview release of v2 migration tool (#5472)
* Create new module for migration tool with basic recipe (#4823) * Create new module for migration tool with basic transformation * Test application * Generate upgrade-sdk-depenencies recipe * Add more tests * Add README and fix test * Generate bom version change * Fix build * Add recipe to change SDK generated types. (#5053) * Add recipe to change SDK generated types. * Address feedback * Account for v1 Services Module Naming Differences (#5109) * Account for v1 module naming differences * Specify full path to diff csv file * Account for v2 modules that do not exist in v1 * Account for v2 modules that do not exist in v1 * Fix checkstyle errors and suppress spotbug errors for ChangeSdkType (#5113) * Add Region class mapping (#5118) * Add NewV1ClassToBuilder recipe (#5115) * Add NewV1ClassToBuilder recipe This recipe transforms the usage of a V1 request class using the `new` keyword to using the V2 class and its builder. This recipe migrates many common uses for making API calls using the V1 SDK: Creating the request outside of the API call and then passing it in as a name variable: ``` SendMessageRequest request = new SendMessage().withQueueUrl(..); sqs.sendMessage(request); ``` or creating it inline ``` sqs.sendMessage(new SendMessageRequest().withQueueUrl(...)); ``` * Review comments Update migration tool tests. This also means adding the the new recipe to the main software.amazon.awssdk.UpgradeJavaSdk2 recipe. * Only run on JDK8 * Preserve prefix when moving from new to builder (#5130) Previously, this SendMessageRequest sendMessage = new SendMessageRequest(); is getting transformed to this (o space after =) SendMessageRequest sendMessage =SendMessageRequest.builder().build(); * Improve test script to log diff (#5131) * Improve diff output when tests fail (#5152) Use difflib's unified_diff to produce a unified diff between the expected and actual file. This has the benefit of including the files compared in the output which makes it easier to do further inspection on them. * Support code transformation for credentials related classes. (#5147) * Support code transformation for credentials related classes. Add NewClassToStaticFactory reciipe to convert objects creating using constructor to static factory method Refactor NewClassToBuilderPattern to support client classes * Fix tests * Flush output after writing diff (#5154) Prevents the output from being garbled by other output. * Add ConstructorToFluent recipe (#5145) * Add ConstructorToFluent recipe The ConstructorToFluent recipe takes a convenience constructor like new GetObjectRequest(myBucket, myKey) and transforms it to use the fluent setter style instead: new GetObjectRequest().withBucketName(myBucket).withKey(myKey) This allows us to take advantage of other recipes that for example switch from using the fluent setters to using the V2-style builders. * Update param type matching * Review comments * Migration Tool Client Config Part 1: map builder variations to the standard builder (#5165) * WIP * Add recipe to convert builder varitions to standard builder method * Add AddCommentToMethod recipe (#5167) * Add AddCommentToMethod recipe * Fix build * Add prefix to comment * Add NumberToDuration recipe to convert numeric type to Duration (#5170) * Add NumberToDuration recipe to convert numeric type to Duration * Fix test * Add S3StreamingResponseToV2 Recipe (#5173) * Add S3StreamingResponseToV2 Recipe This recipe transforms usages of `s3.getObject(..)` such as ``` S3Object myObject = s3.getObject(request); ``` to the equivalent in v2: ``` ResponseInputStream<GetObjectResponse> myObject = s3.getOBject(request); ``` In addition, because of the inversion of streaming and non-streaming members when moving to ResponseInputStream, it further transforms usages of myObject so that calls in v1 that access the stream: ``` myObject.getObjectContent().close() ``` become ``` myObject.close() ``` Likewise, methods that access the non-streaming members ``` myObject.getKey(); ``` become ``` myObject.response().getKey(); ``` * Review comments * Add S3StreamingResponseToV2 to migration recipe (#5180) Update migration tool tests. * Add mappping for non-HTTP config settings and add comments for settings (#5181) * Add package mapping for the new module and exclude it from javadoc exe… (#5197) * Add brazil mapping for the new module and exclude it from javadoc execution * Fix test * Change package name for migration tool and update dependencies (#5200) * Fix NumberToDuraion recipe to handle variable (#5208) * HTTP settings mapping part 1: remove HTTP settings from client configu… (#5211) * HTTP setting mapping part 1: remove HTTP settings from client configuration * Fix formatting * Prefix comment to method call (#5212) Insert the comment to before the method call to make it easier and more apparent what the comment is referring to. Using Space to insert comments here is more idiomatic, and gives us more control of where the comments appear and what they look like. * Add V1GetterToV2 Recipe (#5260) * Add V1GetterToV2 Recipe * Add check for model class * Update recipe path * fix NPE in SdkTypeUtils (#5301) * Fix POJO class naming mapping (#5315) * Change auth type getters to fluent getters (#5318) * Change auth type getters to fluent getters * Fix session credentials * Support HTTP settings mapping (#5308) * Support HTTP settings migration. * Use IdentifierUtils and add more tests * Fix conflict * Revert "Fix conflict" This reverts commit 377884d. * Fix missing space issue for ClientOverrideConfiguration (#5323) * Add mapping for core exception types and getters (#5326) * Wrap region string with Region.of (#5331) * Wrap region string with Region.of * Fix build * Handle wildcard imports in ChangeSdkType recipe (#5336) * Fix V1GetterToV2 to not change get method (#5338) * Fix NPE in ChangeSdkType (#5342) * Account for v1 package service name differences (#5353) * Replace aws-java-sdk-core dependency (#5347) * Replace core dependency * Fix build * Skip transformation for S3 Transfer Manager and DynamoDB mapper (#5364) * Skip transformation for S3 Transfer Manager and DynamoDB mapper * Fix tests * Fix tests * Remove hard-coded version in migration-tool-tests test script (#5366) * Minor refactoring and updating readme (#5370) * Add gradle support and add tests for gradle project (#5368) * Transform defaultClient to create (#5374) * Transform defaultClient to create * Fix return type and spacing * Add parentheses to method patterns (#5384) * Rename module and recipes (#5377) * Add package mapping for rewrite-java-dependencies (#5388) * Fix import for real (#5389) * Add enum getters and casing transforms (#5393) * Fix enum getters and casing * Fix enum getters and casing * Fix enum getters and casing * Fix unit test * Address comments * Address comments * Refactor HttpSettingsToHttpClient to handler client builder without build invoked (#5406) * Transforming S3 PUT override (#5411) * Transforming S3 PUT override * Fix build and add end to end tests --------- Co-authored-by: Dongie Agnir <261310+dagnir@users.noreply.github.com> * Fix package/file naming and test (#5426) * Update recipe display name (#5448) * Doc update (#5447) * Append PREVIEW to the migration tool version and add changelog entry (#5460) * Append PREVIEW to the migration tool version and add changelog entry * Fix build * Update version --------- Co-authored-by: David Ho <70000000+davidh44@users.noreply.github.com> Co-authored-by: Dongie Agnir <261310+dagnir@users.noreply.github.com>
- Loading branch information