From c417bddf479ce67dca5545e19551d0a6a9009ce5 Mon Sep 17 00:00:00 2001 From: Nick Ardecky Date: Mon, 11 Dec 2023 14:01:44 -0800 Subject: [PATCH 1/2] Feature - Update aws-toolkit-commons package - update AmazonQ Code Transform telemetry definitions for new package update --- .../bugfix-32139a16-d00e-43e2-aab8-a356008abfd1.json | 4 ++++ gradle/libs.versions.toml | 2 +- .../services/codemodernizer/CodeModernizerManager.kt | 8 ++++---- .../codemodernizer/CodeWhispererCodeModernizerTest.kt | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 .changes/next-release/bugfix-32139a16-d00e-43e2-aab8-a356008abfd1.json diff --git a/.changes/next-release/bugfix-32139a16-d00e-43e2-aab8-a356008abfd1.json b/.changes/next-release/bugfix-32139a16-d00e-43e2-aab8-a356008abfd1.json new file mode 100644 index 0000000000..9f459dde6b --- /dev/null +++ b/.changes/next-release/bugfix-32139a16-d00e-43e2-aab8-a356008abfd1.json @@ -0,0 +1,4 @@ +{ + "type" : "bugfix", + "description" : "Fix telemetry logging for new Amazon Q Code Transform telemetry updates" +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c74c9abe72..282184c1bb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,7 +20,7 @@ kotlinCoroutines = "1.6.4" mockito = "5.8.0" mockitoKotlin = "5.2.1" mockk = "1.13.8" -telemetryGenerator = "1.0.169" +telemetryGenerator = "1.0.171" testLogger = "3.1.0" testRetry = "1.5.2" slf4j = "1.7.36" diff --git a/jetbrains-core/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerManager.kt b/jetbrains-core/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerManager.kt index 8f200d930b..cda4cbeb73 100644 --- a/jetbrains-core/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerManager.kt +++ b/jetbrains-core/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerManager.kt @@ -116,7 +116,7 @@ class CodeModernizerManager(private val project: Project) : PersistentStateCompo false, message("codemodernizer.notification.warn.invalid_project.description.reason.remote_backend"), InvalidTelemetryReason( - CodeTransformPreValidationError.ProjectRunningOnBackend + CodeTransformPreValidationError.RemoteRunProject ) ) } @@ -126,7 +126,7 @@ class CodeModernizerManager(private val project: Project) : PersistentStateCompo false, message("codemodernizer.notification.warn.invalid_project.description.reason.not_logged_in"), InvalidTelemetryReason( - CodeTransformPreValidationError.NonSSOLogin + CodeTransformPreValidationError.NonSsoLogin ) ) } @@ -147,7 +147,7 @@ class CodeModernizerManager(private val project: Project) : PersistentStateCompo false, message("codemodernizer.notification.warn.invalid_project.description.reason.invalid_jdk_versions", supportedJavaMappings.keys.joinToString()), InvalidTelemetryReason( - CodeTransformPreValidationError.ProjectSelectedIsNotJava8OrJava11, + CodeTransformPreValidationError.UnsupportedJavaVersion, project.tryGetJdk().toString() ) ) @@ -160,7 +160,7 @@ class CodeModernizerManager(private val project: Project) : PersistentStateCompo false, message("codemodernizer.notification.warn.invalid_project.description.reason.no_valid_files", supportedBuildFileNames.joinToString()), InvalidTelemetryReason( - CodeTransformPreValidationError.ProjectSelectedIsNotJava8OrJava11, + CodeTransformPreValidationError.UnsupportedJavaVersion, if (isGradleProject(project)) "Gradle build" else "other build" ) ) diff --git a/jetbrains-core/tst/software/aws/toolkits/jetbrains/services/codewhisperer/codemodernizer/CodeWhispererCodeModernizerTest.kt b/jetbrains-core/tst/software/aws/toolkits/jetbrains/services/codewhisperer/codemodernizer/CodeWhispererCodeModernizerTest.kt index 973b276a4c..f25f735410 100644 --- a/jetbrains-core/tst/software/aws/toolkits/jetbrains/services/codewhisperer/codemodernizer/CodeWhispererCodeModernizerTest.kt +++ b/jetbrains-core/tst/software/aws/toolkits/jetbrains/services/codewhisperer/codemodernizer/CodeWhispererCodeModernizerTest.kt @@ -153,7 +153,7 @@ class CodeWhispererCodeModernizerTest : CodeWhispererCodeModernizerTestBase() { false, message("codemodernizer.notification.warn.invalid_project.description.reason.not_logged_in"), InvalidTelemetryReason( - CodeTransformPreValidationError.NonSSOLogin + CodeTransformPreValidationError.NonSsoLogin ) ) assertEquals(expectedResult, result) From c13e90ed6e77c0360d874f7d4ecf4c74b33c7643 Mon Sep 17 00:00:00 2001 From: Nick Ardecky Date: Mon, 11 Dec 2023 14:01:44 -0800 Subject: [PATCH 2/2] Feature - Update aws-toolkit-commons package - update AmazonQ Code Transform telemetry definitions for new package update --- .../bugfix-32139a16-d00e-43e2-aab8-a356008abfd1.json | 4 ++++ gradle/libs.versions.toml | 2 +- .../services/codemodernizer/CodeModernizerManager.kt | 10 +++++----- .../codemodernizer/CodeWhispererCodeModernizerTest.kt | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 .changes/next-release/bugfix-32139a16-d00e-43e2-aab8-a356008abfd1.json diff --git a/.changes/next-release/bugfix-32139a16-d00e-43e2-aab8-a356008abfd1.json b/.changes/next-release/bugfix-32139a16-d00e-43e2-aab8-a356008abfd1.json new file mode 100644 index 0000000000..9f459dde6b --- /dev/null +++ b/.changes/next-release/bugfix-32139a16-d00e-43e2-aab8-a356008abfd1.json @@ -0,0 +1,4 @@ +{ + "type" : "bugfix", + "description" : "Fix telemetry logging for new Amazon Q Code Transform telemetry updates" +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c74c9abe72..282184c1bb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,7 +20,7 @@ kotlinCoroutines = "1.6.4" mockito = "5.8.0" mockitoKotlin = "5.2.1" mockk = "1.13.8" -telemetryGenerator = "1.0.169" +telemetryGenerator = "1.0.171" testLogger = "3.1.0" testRetry = "1.5.2" slf4j = "1.7.36" diff --git a/jetbrains-core/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerManager.kt b/jetbrains-core/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerManager.kt index 8f200d930b..6f80ad2302 100644 --- a/jetbrains-core/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerManager.kt +++ b/jetbrains-core/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerManager.kt @@ -116,7 +116,7 @@ class CodeModernizerManager(private val project: Project) : PersistentStateCompo false, message("codemodernizer.notification.warn.invalid_project.description.reason.remote_backend"), InvalidTelemetryReason( - CodeTransformPreValidationError.ProjectRunningOnBackend + CodeTransformPreValidationError.RemoteRunProject ) ) } @@ -126,7 +126,7 @@ class CodeModernizerManager(private val project: Project) : PersistentStateCompo false, message("codemodernizer.notification.warn.invalid_project.description.reason.not_logged_in"), InvalidTelemetryReason( - CodeTransformPreValidationError.NonSSOLogin + CodeTransformPreValidationError.NonSsoLogin ) ) } @@ -136,7 +136,7 @@ class CodeModernizerManager(private val project: Project) : PersistentStateCompo false, message("codemodernizer.notification.warn.invalid_project.description.reason.missing_content_roots"), InvalidTelemetryReason( - CodeTransformPreValidationError.EmptyProject + CodeTransformPreValidationError.NoPom ) ) } @@ -147,7 +147,7 @@ class CodeModernizerManager(private val project: Project) : PersistentStateCompo false, message("codemodernizer.notification.warn.invalid_project.description.reason.invalid_jdk_versions", supportedJavaMappings.keys.joinToString()), InvalidTelemetryReason( - CodeTransformPreValidationError.ProjectSelectedIsNotJava8OrJava11, + CodeTransformPreValidationError.UnsupportedJavaVersion, project.tryGetJdk().toString() ) ) @@ -160,7 +160,7 @@ class CodeModernizerManager(private val project: Project) : PersistentStateCompo false, message("codemodernizer.notification.warn.invalid_project.description.reason.no_valid_files", supportedBuildFileNames.joinToString()), InvalidTelemetryReason( - CodeTransformPreValidationError.ProjectSelectedIsNotJava8OrJava11, + CodeTransformPreValidationError.NonMavenProject, if (isGradleProject(project)) "Gradle build" else "other build" ) ) diff --git a/jetbrains-core/tst/software/aws/toolkits/jetbrains/services/codewhisperer/codemodernizer/CodeWhispererCodeModernizerTest.kt b/jetbrains-core/tst/software/aws/toolkits/jetbrains/services/codewhisperer/codemodernizer/CodeWhispererCodeModernizerTest.kt index 973b276a4c..f25f735410 100644 --- a/jetbrains-core/tst/software/aws/toolkits/jetbrains/services/codewhisperer/codemodernizer/CodeWhispererCodeModernizerTest.kt +++ b/jetbrains-core/tst/software/aws/toolkits/jetbrains/services/codewhisperer/codemodernizer/CodeWhispererCodeModernizerTest.kt @@ -153,7 +153,7 @@ class CodeWhispererCodeModernizerTest : CodeWhispererCodeModernizerTestBase() { false, message("codemodernizer.notification.warn.invalid_project.description.reason.not_logged_in"), InvalidTelemetryReason( - CodeTransformPreValidationError.NonSSOLogin + CodeTransformPreValidationError.NonSsoLogin ) ) assertEquals(expectedResult, result)