Skip to content

Commit 46b0a20

Browse files
authored
Merge branch 'main' into auth
2 parents 07c01df + 9a60e50 commit 46b0a20

File tree

7 files changed

+17
-40
lines changed

7 files changed

+17
-40
lines changed

.changes/next-release/feature-a6b77635-5ddb-42c9-a31a-518f8cae1ebc.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,9 @@ class CodeModernizerManager(private val project: Project) : PersistentStateCompo
122122
}
123123
private val artifactHandler = ArtifactHandler(project, GumbyClient.getInstance(project))
124124
private val supportedJavaMappings = mapOf(
125-
JavaSdkVersion.JDK_1_8 to setOf(JavaSdkVersion.JDK_17, JavaSdkVersion.JDK_21),
126-
JavaSdkVersion.JDK_11 to setOf(JavaSdkVersion.JDK_17, JavaSdkVersion.JDK_21),
127-
JavaSdkVersion.JDK_17 to setOf(JavaSdkVersion.JDK_17, JavaSdkVersion.JDK_21),
128-
JavaSdkVersion.JDK_21 to setOf(JavaSdkVersion.JDK_21),
125+
JavaSdkVersion.JDK_1_8 to setOf(JavaSdkVersion.JDK_17),
126+
JavaSdkVersion.JDK_11 to setOf(JavaSdkVersion.JDK_17),
127+
JavaSdkVersion.JDK_17 to setOf(JavaSdkVersion.JDK_17),
129128
)
130129

131130
init {

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,6 @@ private val selectTargetVersionFormItem = FormItem(
179179
FormItemOption(
180180
label = JavaSdkVersion.JDK_17.toString(),
181181
value = JavaSdkVersion.JDK_17.toString(),
182-
),
183-
FormItemOption(
184-
label = JavaSdkVersion.JDK_21.toString(),
185-
value = JavaSdkVersion.JDK_21.toString(),
186182
)
187183
)
188184
)

plugins/amazonq/codetransform/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/codemodernizer/CodeWhispererCodeModernizerGumbyClientTest.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,6 @@ class CodeWhispererCodeModernizerGumbyClientTest : CodeWhispererCodeModernizerTe
146146
}
147147
}
148148

149-
@Test
150-
fun `check startCodeModernization on JAVA_21 target`() {
151-
val actual = gumbyClient.startCodeModernization("jobId", TransformationLanguage.JAVA_8, TransformationLanguage.JAVA_21)
152-
argumentCaptor<StartTransformationRequest>().apply {
153-
verify(bearerClient).startTransformation(capture())
154-
verifyNoInteractions(streamingBearerClient)
155-
assertThat(actual).isInstanceOf(StartTransformationResponse::class.java)
156-
assertThat(actual).usingRecursiveComparison().comparingOnlyFields("transformationJobId").isEqualTo(exampleStartCodeMigrationResponse)
157-
}
158-
}
159-
160149
@Test
161150
fun `check getCodeModernizationPlan`() {
162151
val actual = gumbyClient.getCodeModernizationPlan(JobId("JobId"))

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/credentials/CodeWhispererClientAdaptor.kt

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import com.intellij.openapi.Disposable
77
import com.intellij.openapi.application.ApplicationManager
88
import com.intellij.openapi.components.service
99
import com.intellij.openapi.project.Project
10+
import com.intellij.util.text.nullize
1011
import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider
1112
import software.amazon.awssdk.services.codewhisperer.CodeWhispererClient
1213
import software.amazon.awssdk.services.codewhisperer.model.CreateCodeScanRequest
@@ -146,7 +147,7 @@ interface CodeWhispererClientAdaptor : Disposable {
146147
sessionId: String,
147148
requestId: String,
148149
language: CodeWhispererProgrammingLanguage,
149-
customizationArn: String,
150+
customizationArn: String?,
150151
acceptedCharacterCount: Int,
151152
unmodifiedAcceptedTokenCount: Int,
152153
): SendTelemetryEventResponse
@@ -427,7 +428,7 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
427428
it.timestamp(Instant.now())
428429
it.suggestionReferenceCount(suggestionReferenceCount)
429430
it.generatedLine(lineCount)
430-
it.customizationArn(requestContext.customizationArn)
431+
it.customizationArn(requestContext.customizationArn.nullize(nullizeSpaces = true))
431432
it.numberOfRecommendations(numberOfRecommendations)
432433
it.acceptedCharacterCount(acceptedCharCount)
433434
}
@@ -473,7 +474,7 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
473474
it.timestamp(Instant.now())
474475
it.suggestionReferenceCount(suggestionReferenceCount)
475476
it.generatedLine(lineCount)
476-
it.customizationArn(requestContext.customizationArn)
477+
it.customizationArn(requestContext.customizationArn.nullize(nullizeSpaces = true))
477478
it.numberOfRecommendations(numberOfRecommendations)
478479
it.acceptedCharacterCount(acceptedCharCount)
479480
}
@@ -495,7 +496,7 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
495496
requestBuilder.telemetryEvent { telemetryEventBuilder ->
496497
telemetryEventBuilder.codeCoverageEvent {
497498
it.programmingLanguage { languageBuilder -> languageBuilder.languageName(language.toCodeWhispererRuntimeLanguage().languageId) }
498-
it.customizationArn(customizationArn)
499+
it.customizationArn(customizationArn.nullize(nullizeSpaces = true))
499500
it.acceptedCharacterCount(acceptedTokenCount.toInt())
500501
it.totalCharacterCount(totalTokenCount.toInt())
501502
it.timestamp(Instant.now())
@@ -512,7 +513,7 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
512513
sessionId: String,
513514
requestId: String,
514515
language: CodeWhispererProgrammingLanguage,
515-
customizationArn: String,
516+
customizationArn: String?,
516517
acceptedCharacterCount: Int,
517518
unmodifiedAcceptedTokenCount: Int,
518519
): SendTelemetryEventResponse = bearerClient().sendTelemetryEvent { requestBuilder ->
@@ -523,7 +524,7 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
523524
it.programmingLanguage { languageBuilder ->
524525
languageBuilder.languageName(language.toCodeWhispererRuntimeLanguage().languageId)
525526
}
526-
it.customizationArn(customizationArn)
527+
it.customizationArn(customizationArn.nullize(nullizeSpaces = true))
527528
// deprecated field, service side should not use this % anymore
528529
it.modificationPercentage(0.0)
529530
it.timestamp(Instant.now())
@@ -760,9 +761,7 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
760761
it.responseLength(responseLength)
761762
it.numberOfCodeBlocks(numberOfCodeBlocks)
762763
it.hasProjectLevelContext(hasProjectLevelContext)
763-
customization?.arn?.let { arn ->
764-
it.customizationArn(arn)
765-
}
764+
it.customizationArn(customization?.arn.nullize(nullizeSpaces = true))
766765
}
767766
}
768767
requestBuilder.optOutPreference(getTelemetryOptOutPreference())
@@ -815,9 +814,7 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
815814
}
816815
it.modificationPercentage(modificationPercentage)
817816
it.hasProjectLevelContext(hasProjectLevelContext)
818-
customization?.arn?.let { arn ->
819-
it.customizationArn(arn)
820-
}
817+
it.customizationArn(customization?.arn.nullize(nullizeSpaces = true))
821818
}
822819
}
823820
requestBuilder.optOutPreference(getTelemetryOptOutPreference())

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/telemetry/CodeWhispererUserModificationTracker.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ class CodeWhispererUserModificationTracker(private val project: Project) : Dispo
265265
suggestion.sessionId,
266266
suggestion.requestId,
267267
CodeWhispererLanguageManager.getInstance().getLanguage(suggestion.vFile),
268-
CodeWhispererModelConfigurator.getInstance().activeCustomization(project)?.arn.orEmpty(),
268+
CodeWhispererModelConfigurator.getInstance().activeCustomization(project)?.arn,
269269
suggestion.suggestion.length,
270270
getUnmodifiedAcceptedCharsCount(suggestion.suggestion, modifiedSuggestion)
271271
)

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ codemodernizer.chat.message.button.view_diff=View diff
633633
codemodernizer.chat.message.button.view_failure_build_log=View build log
634634
codemodernizer.chat.message.button.view_summary=View summary
635635
codemodernizer.chat.message.changes_applied=I applied the changes to your project.
636-
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".
636+
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".
637637
codemodernizer.chat.message.choose_objective_placeholder=Enter "language upgrade" or "sql conversion"
638638
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.
639639
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.
@@ -703,8 +703,8 @@ codemodernizer.chat.message.validation.error.invalid_target_db=I can only conver
703703
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.
704704
codemodernizer.chat.message.validation.error.more_info=For more information, see the [Amazon Q documentation]({0}).
705705
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.
706-
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.
707-
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.
706+
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.
707+
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.
708708
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.
709709
codemodernizer.chat.prompt.label.dependency_current_version=Current version
710710
codemodernizer.chat.prompt.label.dependency_name=Dependency name
@@ -778,7 +778,7 @@ codemodernizer.notification.warn.download_failed_other.content=Amazon Q ran into
778778
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.
779779
codemodernizer.notification.warn.download_failed_wildcard.content=Check your IDE proxy settings and remove any wildcard (*) references, and then try viewing the diff again.
780780
codemodernizer.notification.warn.expired_credentials.title=Your connection to Q has expired
781-
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.
781+
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.
782782
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).
783783
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.
784784
codemodernizer.notification.warn.maven_failed.content=Amazon Q could not run the Maven clean install command to build your module.

0 commit comments

Comments
 (0)