Skip to content

Commit da1446d

Browse files
dhasani23David Hasani
andauthored
fix(amazonq): minor text update (#5853)
Co-authored-by: David Hasani <[email protected]>
1 parent 11d2e8a commit da1446d

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,8 @@ fun buildUserInputSQLConversionMetadataChatContent() = CodeTransformChatMessageC
347347
type = CodeTransformChatMessageType.FinalizedAnswer,
348348
)
349349

350-
fun buildUserInputCustomDependencyVersionsChatContent() = CodeTransformChatMessageContent(
351-
message = message("codemodernizer.chat.message.custom_dependency_upgrades_prompt"),
350+
fun buildUserInputCustomDependencyVersionsChatContent(message: String) = CodeTransformChatMessageContent(
351+
message = message,
352352
buttons = listOf(
353353
confirmCustomDependencyVersionsButton,
354354
continueTransformationButton,

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,13 @@ class CodeTransformChatController(
465465
}
466466

467467
private suspend fun promptForCustomYamlFile() {
468-
codeTransformChatHelper.addNewMessage(buildUserInputCustomDependencyVersionsChatContent())
468+
val sourceJdk = codeModernizerManager.codeTransformationSession?.sessionContext?.sourceJavaVersion?.name
469+
val targetJdk = codeModernizerManager.codeTransformationSession?.sessionContext?.targetJavaVersion?.name
470+
var message = message("codemodernizer.chat.message.custom_dependency_upgrades_prompt_library_upgrade")
471+
if (sourceJdk != targetJdk) {
472+
message = message("codemodernizer.chat.message.custom_dependency_upgrades_prompt_jdk_upgrade")
473+
}
474+
codeTransformChatHelper.addNewMessage(buildUserInputCustomDependencyVersionsChatContent(message))
469475
val sampleYAML = """
470476
name: "dependency-upgrade"
471477
description: "Custom dependency version management for Java migration from JDK 8/11/17 to JDK 17/21"

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,8 @@ codemodernizer.chat.message.choose_objective=I can help you with the following t
648648
codemodernizer.chat.message.choose_objective_placeholder=Enter "language upgrade" or "sql conversion"
649649
codemodernizer.chat.message.custom_dependency_upgrades_continue=Ok, I will continue the transformation without additional dependency upgrade information.
650650
codemodernizer.chat.message.custom_dependency_upgrades_invalid=I wasn't able to parse the dependency upgrade file. Check that it's configured properly and try again. For an example of the required dependency upgrade file format, see the [documentation](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/code-transformation.html#dependency-upgrade-file).
651-
codemodernizer.chat.message.custom_dependency_upgrades_prompt=Would you like to provide a dependency upgrade file? You can specify first-party dependencies to upgrade in a YAML file, and I will upgrade them during the JDK upgrade (for example, Java 8 to 17). You can initiate a separate transformation (17 to 17 or 21 to 21) after the initial JDK upgrade to transform third-party dependencies.\n\nWithout a YAML file, I can perform a minimum JDK upgrade, and then you can initiate a separate transformation to upgrade all third-party dependencies as part of a maximum transformation. For an example dependency upgrade file, see the [documentation](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/code-transformation.html#dependency-upgrade-file).
651+
codemodernizer.chat.message.custom_dependency_upgrades_prompt_jdk_upgrade=Would you like to provide a dependency upgrade file? You can specify first party dependencies and their versions in a YAML file, and I will upgrade them during the JDK upgrade transformation. For an example dependency upgrade file, see the [documentation](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/code-transformation.html#dependency-upgrade-file).
652+
codemodernizer.chat.message.custom_dependency_upgrades_prompt_library_upgrade=Would you like to provide a dependency upgrade file? You can specify third party dependencies and their versions in a YAML file, and I will only upgrade these dependencies during the library upgrade transformation. For an example dependency upgrade file, see the [documentation](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/code-transformation.html#dependency-upgrade-file).
652653
codemodernizer.chat.message.custom_dependency_upgrades_valid=The dependency upgrade file looks good. I will use this information to upgrade the dependencies you specified.
653654
codemodernizer.chat.message.download_failed_client_instructions_expired=Your transformation is not available anymore. Your code and transformation summary are deleted 24 hours after the transformation completes. Please try starting the transformation again.
654655
codemodernizer.chat.message.download_failed_invalid_artifact=Sorry, I was unable to find your {0}. Artifacts are deleted after 24 hours. Please try starting the transformation again.

0 commit comments

Comments
 (0)