Skip to content

Commit fdbde7d

Browse files
author
David Hasani
committed
fix detekt
1 parent bcb096f commit fdbde7d

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

.kotlin/sessions/kotlin-compiler-3716745130316675982.salive

Whitespace-only changes.

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ class CodeTransformChatController(
124124
codeTransformChatHelper.sendChatInputEnabledMessage(message.tabId, false)
125125
codeTransformChatHelper.sendUpdatePlaceholderMessage(message.tabId, "Open a new tab to chat with Q")
126126

127+
// since we're prompting the user, their module(s) must be eligible for both types of transformations, so track how often this happens here
128+
if (objective === "language upgrade" || objective === "sql conversion") {
129+
telemetry.submitSelection(objective)
130+
}
131+
127132
when (objective) {
128133
"language upgrade" -> this.handleLanguageUpgrade()
129134
"sql conversion" -> this.handleSQLConversion()
@@ -346,7 +351,9 @@ class CodeTransformChatController(
346351
addNewMessage(buildSQLMetadataValidationSuccessIntroChatContent())
347352
addNewMessage(buildSQLMetadataValidationSuccessDetailsChatContent(metadataValidationResult))
348353
addNewMessage(buildModuleSchemaFormIntroChatContent())
349-
addNewMessage(buildModuleSchemaFormChatContent(context.project, context.project.getJavaModulesWithSQL(), metadataValidationResult.schemaOptions))
354+
addNewMessage(
355+
buildModuleSchemaFormChatContent(context.project, context.project.getJavaModulesWithSQL(), metadataValidationResult.schemaOptions)
356+
)
350357
}
351358
val selection = CustomerSelection(
352359
// for SQL conversions (no sourceJavaVersion), use dummy value of Java 8 so that startJob API can be called

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import kotlin.time.toKotlinDuration
99

1010
data class JobHistoryItem(val moduleName: String?, val status: String, val startTime: Instant, val runTime: java.time.Duration, val jobId: String) {
1111
operator fun get(col: Int): Any = when (col) {
12-
0 -> moduleName ?: ""
12+
0 -> moduleName.orEmpty()
1313
1 -> status
1414
2 -> startTime
1515
3 -> runTime.toKotlinDuration().inWholeSeconds.seconds.toString()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fun buildState(context: CodeModernizerSessionContext, isJobOngoing: Boolean, job
2828
lastJobContext.putAll(
2929
setOf(
3030
JobDetails.LAST_JOB_ID to jobId.id,
31-
JobDetails.CONFIGURATION_FILE_PATH to if (context.configurationFile != null) context.configurationFile!!.path else "",
31+
JobDetails.CONFIGURATION_FILE_PATH to (context.configurationFile?.path ?: error("No configuration file store in the state")),
3232
JobDetails.TARGET_JAVA_VERSION to context.targetJavaVersion.description,
3333
JobDetails.SOURCE_JAVA_VERSION to context.sourceJavaVersion.description,
3434
JobDetails.CUSTOM_BUILD_COMMAND to context.customBuildCommand

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ code.aws.workspaces.short=Dev Environments
564564
codemodernizer.builderrordialog.description.title=Error occurred when building your project
565565
codemodernizer.chat.form.user_selection.item.choose_module=Choose a module to transform
566566
codemodernizer.chat.form.user_selection.item.choose_skip_tests_option=Choose to skip unit tests
567-
codemodernizer.chat.form.user_selection.item.choose_sql_metadata_file=Okay, I can convert the embedded SQL code for your Oracle to PostgreSQL migration. To get started, upload the zipped metadata file from your schema conversion in AWS DMS. To retrieve the metadata file: \n1. Open your database migration project in the AWS DMS console. \n2. Open the schema conversion and choose **Convert the embedded SQL in your application**. \n3. Choose the link to Amazon S3 console. You can download the metadata file from the {schema-conversion-project}/ directory.
567+
codemodernizer.chat.form.user_selection.item.choose_sql_metadata_file=Okay, I can convert the embedded SQL code for your Oracle to PostgreSQL transformation. To get started, upload the zipped metadata file from your schema conversion in AWS Data Migration Service (DMS). To retrieve the metadata file:\n1. Open your database migration project in the AWS DMS console.\n2. Open the schema conversion and choose **Convert the embedded SQL in your application**.\n3. Choose the link to Amazon S3 console.\n\nYou can download the metadata file from the {schema-conversion-project}/ directory. For more info, refer to the [documentation](https://docs.aws.amazon.com/dms/latest/userguide/schema-conversion-save-apply.html#schema-conversion-save).
568568
codemodernizer.chat.form.user_selection.item.choose_target_version=Choose the target code version
569569
codemodernizer.chat.form.user_selection.title=Q - Code transformation
570570
codemodernizer.chat.message.absolute_path_detected=I detected {0} potential absolute file path(s) in your {1} file: **{2}**. Absolute file paths might cause issues when I build your code. Any errors will show up in the build log.
@@ -575,7 +575,7 @@ codemodernizer.chat.message.button.hil_cancel=Cancel
575575
codemodernizer.chat.message.button.hil_submit=Submit
576576
codemodernizer.chat.message.button.open_file=Open file
577577
codemodernizer.chat.message.button.open_transform_hub=Open Transformation Hub
578-
codemodernizer.chat.message.button.select_sql_metadata=Upload metadata file
578+
codemodernizer.chat.message.button.select_sql_metadata=Select metadata file
579579
codemodernizer.chat.message.button.stop_transform=Stop transformation
580580
codemodernizer.chat.message.button.view_build=View build progress
581581
codemodernizer.chat.message.button.view_diff=View diff
@@ -622,7 +622,7 @@ codemodernizer.chat.message.skip_tests=I will build your module using `mvn test`
622622
codemodernizer.chat.message.skip_tests_form.response=Okay, I will {0} when building your module.
623623
codemodernizer.chat.message.skip_tests_form.run_tests=Run unit tests
624624
codemodernizer.chat.message.skip_tests_form.skip=Skip unit tests
625-
codemodernizer.chat.message.sql_metadata_success=I retrieved the following information from the schema conversion metadata you provided:
625+
codemodernizer.chat.message.sql_metadata_success=I found the following source database, target database, and host based on the schema conversion metadata you provided:
626626
codemodernizer.chat.message.sql_module_schema_prompt=To continue, choose the module and schema for this transformation.
627627
codemodernizer.chat.message.transform_begin=I'm starting to transform 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.
628628
codemodernizer.chat.message.transform_cancelled_by_user=I cancelled your transformation. If you want to start another transformation, choose **Start a new transformation**.

0 commit comments

Comments
 (0)