Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type" : "feature",
"description" : "/transform: support transformations to Java 21"
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@
}
private val artifactHandler = ArtifactHandler(project, GumbyClient.getInstance(project))
private val supportedJavaMappings = mapOf(
JavaSdkVersion.JDK_1_8 to setOf(JavaSdkVersion.JDK_17),
JavaSdkVersion.JDK_11 to setOf(JavaSdkVersion.JDK_17),
JavaSdkVersion.JDK_17 to setOf(JavaSdkVersion.JDK_17),
JavaSdkVersion.JDK_1_8 to setOf(JavaSdkVersion.JDK_17, JavaSdkVersion.JDK_21),
JavaSdkVersion.JDK_11 to setOf(JavaSdkVersion.JDK_17, JavaSdkVersion.JDK_21),
JavaSdkVersion.JDK_17 to setOf(JavaSdkVersion.JDK_17, JavaSdkVersion.JDK_21),
JavaSdkVersion.JDK_21 to setOf(JavaSdkVersion.JDK_21),

Check warning on line 128 in plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerManager.kt

View check run for this annotation

Codecov / codecov/patch

plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerManager.kt#L125-L128

Added lines #L125 - L128 were not covered by tests
)

init {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@
FormItemOption(
label = JavaSdkVersion.JDK_17.toString(),
value = JavaSdkVersion.JDK_17.toString(),
),
FormItemOption(
label = JavaSdkVersion.JDK_21.toString(),
value = JavaSdkVersion.JDK_21.toString(),

Check warning on line 185 in plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/constants/CodeTransformChatItems.kt

View check run for this annotation

Codecov / codecov/patch

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

Added lines #L183 - L185 were not covered by tests
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ class CodeWhispererCodeModernizerGumbyClientTest : CodeWhispererCodeModernizerTe
}
}

@Test
fun `check startCodeModernization on JAVA_21 target`() {
val actual = gumbyClient.startCodeModernization("jobId", TransformationLanguage.JAVA_8, TransformationLanguage.JAVA_21)
argumentCaptor<StartTransformationRequest>().apply {
verify(bearerClient).startTransformation(capture())
verifyNoInteractions(streamingBearerClient)
assertThat(actual).isInstanceOf(StartTransformationResponse::class.java)
assertThat(actual).usingRecursiveComparison().comparingOnlyFields("transformationJobId").isEqualTo(exampleStartCodeMigrationResponse)
}
}

@Test
fun `check getCodeModernizationPlan`() {
val actual = gumbyClient.getCodeModernizationPlan(JobId("JobId"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ codemodernizer.chat.message.button.view_diff=View diff
codemodernizer.chat.message.button.view_failure_build_log=View build log
codemodernizer.chat.message.button.view_summary=View summary
codemodernizer.chat.message.changes_applied=I applied the changes to your project.
codemodernizer.chat.message.choose_objective=I can help you with the following tasks:\n- Upgrade your Java 8 and Java 11 codebases to Java 17.\n- Upgrade Java 17 code with up-to-date libraries and other dependencies.\n- Convert embedded SQL code for Oracle to PostgreSQL database migrations in AWS DMS.\n\nWhat would you like to do? You can enter "language upgrade" or "sql conversion".
codemodernizer.chat.message.choose_objective=I can help you with the following tasks:\n- Upgrade your Java 8, Java 11, and Java 17 codebases to Java 17 or Java 21.\n- Upgrade Java 17 or Java 21 code with up-to-date libraries and other dependencies.\n- Convert embedded SQL code for Oracle to PostgreSQL database migrations in AWS DMS.\n\nWhat would you like to do? You can enter "language upgrade" or "sql conversion".
codemodernizer.chat.message.choose_objective_placeholder=Enter "language upgrade" or "sql conversion"
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.
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.
Expand Down Expand Up @@ -703,8 +703,8 @@ codemodernizer.chat.message.validation.error.invalid_target_db=I can only conver
codemodernizer.chat.message.validation.error.missing_sct_file=An .sct file is required for transformation. Make sure that you've uploaded the .zip file you retrieved from your schema conversion in AWS DMS.
codemodernizer.chat.message.validation.error.more_info=For more information, see the [Amazon Q documentation]({0}).
codemodernizer.chat.message.validation.error.no_java_project=Sorry, I could not find an open Java module with embedded Oracle SQL statements. Make sure you have a Java module open that has at least 1 content root.
codemodernizer.chat.message.validation.error.other=I couldn't find a module that I can upgrade. Currently, I support Java 8, Java 11, and Java 17 projects built on Maven. Make sure your project is open in the IDE. If you have a Java 8, Java 11, or Java 17 module in your workspace, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and the correct language level. In the Modules tab, set the correct module JDK and language level.
codemodernizer.chat.message.validation.error.unsupported_module=I couldn't find a module that I can upgrade. Currently, I support Java 8, Java 11, and Java 17 projects built on Maven. Make sure your project is open in the IDE. If you have a Java 8, Java 11, or Java 17 module in your workspace, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and the correct language level. In the Modules tab, set the correct module JDK and language level.
codemodernizer.chat.message.validation.error.other=I couldn't find a module that I can upgrade. Currently, I support Java 8, Java 11, Java 17, and Java 21 projects built on Maven. Make sure your project is open in the IDE. If you have a Java 8, Java 11, Java 17, or Java 21 module in your workspace, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and the correct language level. In the Modules tab, set the correct module JDK and language level.
codemodernizer.chat.message.validation.error.unsupported_module=I couldn't find a module that I can upgrade. Currently, I support Java 8, Java 11, Java 17, and Java 21 projects built on Maven. Make sure your project is open in the IDE. If you have a Java 8, Java 11, Java 17, or Java 21 in your workspace, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and the correct language level. In the Modules tab, set the correct module JDK and language level.
codemodernizer.chat.message.validation.no_jdk=I couldn't build your project with your current JDK configuration. To update your JDK, go to File and choose Project Structure. In the Projects tab, set the correct project JDK in the SDK field. In the Modules tab, set the correct module JDK in the SDK field. In Maven Runner settings, set the correct JDK in the JRE field.
codemodernizer.chat.prompt.label.dependency_current_version=Current version
codemodernizer.chat.prompt.label.dependency_name=Dependency name
Expand Down Expand Up @@ -778,7 +778,7 @@ codemodernizer.notification.warn.download_failed_other.content=Amazon Q ran into
codemodernizer.notification.warn.download_failed_ssl.content=Please make sure all your certificates for your proxy client have been set up correctly for your IDE.
codemodernizer.notification.warn.download_failed_wildcard.content=Check your IDE proxy settings and remove any wildcard (*) references, and then try viewing the diff again.
codemodernizer.notification.warn.expired_credentials.title=Your connection to Q has expired
codemodernizer.notification.warn.invalid_project.description.reason.missing_content_roots=None of your open modules are supported for code transformation with Amazon Q. Amazon Q can upgrade Java 8, Java 11, and Java 17 projects built on Maven, with content roots configured.
codemodernizer.notification.warn.invalid_project.description.reason.missing_content_roots=None of your open modules are supported for code transformation with Amazon Q. Amazon Q can upgrade Java 8, Java 11, Java 17, and Java 21 projects built on Maven, with content roots configured.
codemodernizer.notification.warn.invalid_project.description.reason.not_logged_in=Amazon Q cannot start the transformation as you are not logged in with Identity Center or Builder ID. Also ensure that you are not using IntelliJ version 232.8660.185 and that you are not developing on a remote host (uncommon).
codemodernizer.notification.warn.invalid_project.description.reason.remote_backend=None of your open modules are supported for code transformation with Amazon Q. Amazon Q cannot transform modules running on a remote host.
codemodernizer.notification.warn.maven_failed.content=Amazon Q could not run the Maven clean install command to build your module.
Expand Down
Loading