Skip to content

Commit 91d5a0c

Browse files
feat(amazon q): removing feature flag for selective transformation and confirmed string changes (#5117)
* removing feature flag for selective transformation and confirmed string changes * fix to use refreshAndFindFileByNioFile instead --------- Co-authored-by: David <[email protected]>
1 parent 9729ac9 commit 91d5a0c

File tree

5 files changed

+16
-19
lines changed

5 files changed

+16
-19
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "feature",
3+
"description" : "Feature(Amazon Q Code Transformation): allow users to view results in 5 smaller diffs"
4+
}

plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/ArtifactHandler.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ val patchDescriptions = mapOf(
7171
"Popular Enterprise Specifications and Application Frameworks upgrade" to "This diff patch covers the set of upgrades for Jakarta EE 10, Hibernate 6.2, " +
7272
"and Micronaut 3.",
7373
"HTTP Client Utilities, Apache Commons Utilities, and Web Frameworks" to "This diff patch covers the set of upgrades for Apache HTTP Client 5, Apache " +
74-
"Commons utilities (Collections, IO, Lang, Math), Struts 6.0.",
75-
"Testing Tools and Frameworks upgrade" to "This diff patch covers the set of upgrades for ArchUnit, Mockito, TestContainers, Cucumber, and additionally, " +
76-
"Jenkins plugins and the Maven Wrapper.",
74+
"Commons utilities (Collections, IO, Lang, Math), and Struts 6.0.",
75+
"Testing Tools and Frameworks upgrade" to "This diff patch covers the set of upgrades for ArchUnit, Mockito, TestContainers, and Cucumber, in addition " +
76+
"to the Jenkins plugins and the Maven Wrapper.",
7777
"Miscellaneous Processing Documentation upgrade" to "This diff patch covers a diverse set of upgrades spanning ORMs, XML processing, API documentation, " +
7878
"and more.",
7979
"Deprecated API replacement, dependency upgrades, and formatting" to "This diff patch replaces deprecated APIs, makes additional dependency version " +

plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/controller/CodeTransformChatController.kt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -378,20 +378,13 @@ class CodeTransformChatController(
378378
message("codemodernizer.chat.message.skip_tests_form.skip") -> MAVEN_BUILD_SKIP_UNIT_TESTS
379379
else -> MAVEN_BUILD_RUN_UNIT_TESTS
380380
}
381-
// feature flag for Selective Transformation
382-
val isSelectiveTransformationReady = false
383381
codeTransformChatHelper.addNewMessage(buildUserSkipTestsFlagSelectionChatContent(message.skipTestsSelection))
384382
codeModernizerManager.codeTransformationSession?.let {
385383
it.sessionContext.customBuildCommand = customBuildCommand
386-
if (!isSelectiveTransformationReady) {
387-
codeModernizerManager.runLocalMavenBuild(context.project, it)
388-
}
389384
}
390-
if (isSelectiveTransformationReady) {
391-
codeTransformChatHelper.run {
392-
addNewMessage(buildUserInputOneOrMultipleDiffsChatIntroContent())
393-
addNewMessage(buildUserInputOneOrMultipleDiffsFlagChatContent())
394-
}
385+
codeTransformChatHelper.run {
386+
addNewMessage(buildUserInputOneOrMultipleDiffsChatIntroContent())
387+
addNewMessage(buildUserInputOneOrMultipleDiffsFlagChatContent())
395388
}
396389
}
397390

plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/model/CodeModernizerArtifact.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ open class CodeModernizerArtifact(
129129
return description.map { patchInfo ->
130130
val patchFile = patchesDir.resolve(patchInfo.filename)
131131
if (patchFile.toFile().exists()) {
132-
fileSystem.findFileByNioFile(patchFile)
132+
fileSystem.refreshAndFindFileByNioFile(patchFile)
133133
?: error("Could not find patch: ${patchInfo.filename}")
134134
} else {
135135
error("Patch file not found: ${patchInfo.filename}")

plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -612,18 +612,18 @@ codemodernizer.chat.message.hil.user_rejected=I'll continue upgrading your modul
612612
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.
613613
codemodernizer.chat.message.local_build_failed=Sorry, I couldn't run the Maven clean install command to build your module.
614614
codemodernizer.chat.message.local_build_success=I was able to build your module and will start uploading your code.
615-
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.
615+
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.
616616
codemodernizer.chat.message.one_or_multiple_diffs_form.multiple_diffs=Multiple diffs
617617
codemodernizer.chat.message.one_or_multiple_diffs_form.one_diff=One diff
618-
codemodernizer.chat.message.one_or_multiple_diffs_form.response=Okay, I will create {0} when providing the proposed changes.
618+
codemodernizer.chat.message.one_or_multiple_diffs_form.response=Okay, I will create {0} with my proposed changes.
619619
codemodernizer.chat.message.result.fail=Sorry, I ran into an issue during the transformation. Please try again.
620620
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.
621621
codemodernizer.chat.message.result.fail_initial_build_no_build_log=I am having trouble building your project in the secure build environment: {0}.
622622
codemodernizer.chat.message.result.fail_with_known_reason=Sorry, I couldn''t complete the transformation. {0}
623623
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.
624-
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.
625-
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.
626-
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.
624+
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.
625+
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.
626+
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.
627627
codemodernizer.chat.message.result.zip_too_large=Sorry, your project size exceeds the Amazon Q Code Transformation upload limit of 2GB.
628628
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.
629629
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`.

0 commit comments

Comments
 (0)