diff --git a/.changes/next-release/feature-07ba60de-7043-4965-8fb5-7038c8ea6c5e.json b/.changes/next-release/feature-07ba60de-7043-4965-8fb5-7038c8ea6c5e.json new file mode 100644 index 00000000000..93b0197b9f5 --- /dev/null +++ b/.changes/next-release/feature-07ba60de-7043-4965-8fb5-7038c8ea6c5e.json @@ -0,0 +1,4 @@ +{ + "type" : "feature", + "description" : "Feature(Amazon Q Code Transformation): allow users to view results in 5 smaller diffs" +} \ No newline at end of file diff --git a/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/ArtifactHandler.kt b/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/ArtifactHandler.kt index c6790fad8be..b0608d1f07c 100644 --- a/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/ArtifactHandler.kt +++ b/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/ArtifactHandler.kt @@ -71,9 +71,9 @@ val patchDescriptions = mapOf( "Popular Enterprise Specifications and Application Frameworks upgrade" to "This diff patch covers the set of upgrades for Jakarta EE 10, Hibernate 6.2, " + "and Micronaut 3.", "HTTP Client Utilities, Apache Commons Utilities, and Web Frameworks" to "This diff patch covers the set of upgrades for Apache HTTP Client 5, Apache " + - "Commons utilities (Collections, IO, Lang, Math), Struts 6.0.", - "Testing Tools and Frameworks upgrade" to "This diff patch covers the set of upgrades for ArchUnit, Mockito, TestContainers, Cucumber, and additionally, " + - "Jenkins plugins and the Maven Wrapper.", + "Commons utilities (Collections, IO, Lang, Math), and Struts 6.0.", + "Testing Tools and Frameworks upgrade" to "This diff patch covers the set of upgrades for ArchUnit, Mockito, TestContainers, and Cucumber, in addition " + + "to the Jenkins plugins and the Maven Wrapper.", "Miscellaneous Processing Documentation upgrade" to "This diff patch covers a diverse set of upgrades spanning ORMs, XML processing, API documentation, " + "and more.", "Deprecated API replacement, dependency upgrades, and formatting" to "This diff patch replaces deprecated APIs, makes additional dependency version " + diff --git a/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/controller/CodeTransformChatController.kt b/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/controller/CodeTransformChatController.kt index 5edbe1d465e..a31615d4e2d 100644 --- a/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/controller/CodeTransformChatController.kt +++ b/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/controller/CodeTransformChatController.kt @@ -378,20 +378,13 @@ class CodeTransformChatController( message("codemodernizer.chat.message.skip_tests_form.skip") -> MAVEN_BUILD_SKIP_UNIT_TESTS else -> MAVEN_BUILD_RUN_UNIT_TESTS } - // feature flag for Selective Transformation - val isSelectiveTransformationReady = false codeTransformChatHelper.addNewMessage(buildUserSkipTestsFlagSelectionChatContent(message.skipTestsSelection)) codeModernizerManager.codeTransformationSession?.let { it.sessionContext.customBuildCommand = customBuildCommand - if (!isSelectiveTransformationReady) { - codeModernizerManager.runLocalMavenBuild(context.project, it) - } } - if (isSelectiveTransformationReady) { - codeTransformChatHelper.run { - addNewMessage(buildUserInputOneOrMultipleDiffsChatIntroContent()) - addNewMessage(buildUserInputOneOrMultipleDiffsFlagChatContent()) - } + codeTransformChatHelper.run { + addNewMessage(buildUserInputOneOrMultipleDiffsChatIntroContent()) + addNewMessage(buildUserInputOneOrMultipleDiffsFlagChatContent()) } } diff --git a/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/model/CodeModernizerArtifact.kt b/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/model/CodeModernizerArtifact.kt index 2896ba41127..555570dd8cd 100644 --- a/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/model/CodeModernizerArtifact.kt +++ b/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/model/CodeModernizerArtifact.kt @@ -129,7 +129,7 @@ open class CodeModernizerArtifact( return description.map { patchInfo -> val patchFile = patchesDir.resolve(patchInfo.filename) if (patchFile.toFile().exists()) { - fileSystem.findFileByNioFile(patchFile) + fileSystem.refreshAndFindFileByNioFile(patchFile) ?: error("Could not find patch: ${patchInfo.filename}") } else { error("Patch file not found: ${patchInfo.filename}") diff --git a/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties b/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties index b823b0507f3..27b0afadaa4 100644 --- a/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties +++ b/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties @@ -612,18 +612,18 @@ codemodernizer.chat.message.hil.user_rejected=I'll continue upgrading your modul codemodernizer.chat.message.local_build_begin=I'm building your module. This can take up to 10 minutes, depending on the size of your module. codemodernizer.chat.message.local_build_failed=Sorry, I couldn't run the Maven clean install command to build your module. codemodernizer.chat.message.local_build_success=I was able to build your module and will start uploading your code. -codemodernizer.chat.message.one_or_multiple_diffs=I can now divide the transformation results into diff patches (if applicable to the app) if you would like to review and accept each diff with fewer changes:\n\n\ - Minimal Compatible Library Upgrade to Java 17: Dependencies to the minimum compatible versions in Java 17, including Springboot, JUnit, and PowerMockito.\n\n\ - Popular Enterprise Specifications Application Frameworks: Popular enterprise and application frameworks like Jakarta EE, Hibernate, and Micronaut 3.\n\n\ - HTTP Client Utilities Web Frameworks: HTTP client libraries, Apache Commons utilities, and Struts frameworks.\n\n\ - Testing Tools Frameworks: Testing tools like ArchUnit, Mockito, and TestContainers and build tools like Jenkins and Maven Wrapper.\n\n\ - Miscellaneous Processing Documentation: Diverse set spanning ORMs, XML processing, and API documentation like Swagger to SpringDoc/OpenAPI.\n\n\ - Deprecated API replacement, dependency upgrades, and formatting: Replaces deprecated APIs, makes additional dependency version upgrades, and formats code changes. +codemodernizer.chat.message.one_or_multiple_diffs=If you'd like to update and test your code with fewer changes at a time, I can divide the transformation results into separate diff patches. If applicable to your application, I can split up the diffs up into the following groups of upgrades. Here are the upgrades included in each diff:\n\n\ - Minimal Compatible Library Upgrade to Java 17: Dependencies to the minimum compatible versions in Java 17, including Springboot, JUnit, and PowerMockito.\n\n\ - Popular Enterprise Specifications Application Frameworks: Popular enterprise and application frameworks like Jakarta EE, Hibernate, and Micronaut 3.\n\n\ - HTTP Client Utilities Web Frameworks: HTTP client libraries, Apache Commons utilities, and Struts frameworks.\n\n\ - Testing Tools Frameworks: Testing tools like ArchUnit, Mockito, and TestContainers and build tools like Jenkins and Maven Wrapper.\n\n\ - Miscellaneous Processing Documentation: Diverse set spanning ORMs, XML processing, and API documentation like Swagger to SpringDoc/OpenAPI.\n\n\ - Deprecated API replacement, dependency upgrades, and formatting: Replaces deprecated APIs, makes additional dependency version upgrades, and formats code changes. codemodernizer.chat.message.one_or_multiple_diffs_form.multiple_diffs=Multiple diffs codemodernizer.chat.message.one_or_multiple_diffs_form.one_diff=One diff -codemodernizer.chat.message.one_or_multiple_diffs_form.response=Okay, I will create {0} when providing the proposed changes. +codemodernizer.chat.message.one_or_multiple_diffs_form.response=Okay, I will create {0} with my proposed changes. codemodernizer.chat.message.result.fail=Sorry, I ran into an issue during the transformation. Please try again. codemodernizer.chat.message.result.fail_initial_build=I am having trouble building your project in the secure build environment and couldn't complete the transformation. codemodernizer.chat.message.result.fail_initial_build_no_build_log=I am having trouble building your project in the secure build environment: {0}. codemodernizer.chat.message.result.fail_with_known_reason=Sorry, I couldn''t complete the transformation. {0} codemodernizer.chat.message.result.partially_success=I transformed part of your code. You can review the diff to see my proposed changes and accept or reject them. The transformation summary has details about the files I updated and the errors that prevented a complete transformation. -codemodernizer.chat.message.result.partially_success.multiple_diffs=I upgraded part of your code to Java 17. You can review the diff to see my proposed changes and accept or reject them. If you reject the diff, you will not be able to see the diffs later. The transformation summary has details about the files I updated and the errors that prevented a complete transformation. -codemodernizer.chat.message.result.success=I successfully transformed your code. You can review the diff to see my proposed changes and accept or reject them. The transformation summary has details about the files I updated. -codemodernizer.chat.message.result.success.multiple_diffs=I successfully upgraded your code to Java 17. You can review the diff to see my proposed changes and accept or reject them. If you reject the diff, you will not be able to see the diffs later. The transformation summary has details about the files I updated. +codemodernizer.chat.message.result.partially_success.multiple_diffs=I transformed part of your code. You will be able to accept changes from one diff at a time. If you reject changes in one diff, you will not be able to view or accept changes in the other diffs. The transformation summary has details about the files I updated and the errors that prevented a complete transformation. +codemodernizer.chat.message.result.success=I successfully completed your transformation. You can review the diff to see my proposed changes and accept or reject them. The transformation summary has details about the changes I'm proposing. +codemodernizer.chat.message.result.success.multiple_diffs=I successfully completed your transformation. You will be able to accept changes from one diff at a time. If you reject changes in one diff, you will not be able to view or accept changes in the other diffs. The transformation summary has details about the changes I'm proposing. codemodernizer.chat.message.result.zip_too_large=Sorry, your project size exceeds the Amazon Q Code Transformation upload limit of 2GB. codemodernizer.chat.message.resume_ongoing=I'm still transforming your code. It can take 10 to 30 minutes to upgrade your code, depending on the size of your module. To monitor progress, go to the Transformation Hub. codemodernizer.chat.message.skip_tests=I will build your module using `mvn test` by default. If you would like me to build your module without running unit tests, I will use `mvn test-compile`.