Skip to content

Commit 9400ba7

Browse files
authored
Merge branch 'main' into create-upload-telemetry
2 parents 7f2d34a + 3c7a01d commit 9400ba7

File tree

13 files changed

+29
-51
lines changed

13 files changed

+29
-51
lines changed

.changes/3.58.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"date" : "2025-03-06",
3+
"version" : "3.58",
4+
"entries" : [ {
5+
"type" : "bugfix",
6+
"description" : "Amazon Q: Fix data isolation between tabs to prevent interference when using /doc in multiple tabs"
7+
}, {
8+
"type" : "removal",
9+
"description" : "The Amazon Q inline suggestion popup goes back to being under the suggestions and is always showing."
10+
} ]
11+
}

.changes/next-release/bugfix-79596dfc-37a0-44c8-adf2-a6c87ba806ac.json

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

.changes/next-release/feature-0b164167-b04b-4a26-a59b-5ac41a717975.json

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

.changes/next-release/removal-5b5b9cf3-701c-48b5-b232-96e726a9a860.json

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

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# _3.58_ (2025-03-06)
2+
- **(Bug Fix)** Amazon Q: Fix data isolation between tabs to prevent interference when using /doc in multiple tabs
3+
- **(Removal)** The Amazon Q inline suggestion popup goes back to being under the suggestions and is always showing.
4+
15
# _3.57_ (2025-02-28)
26
- **(Bug Fix)** Fix suggestion not visible in remote for 2024.3
37
- **(Bug Fix)** /test: update capability card text

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ reported the issue. Please try to include as much information as you can. Detail
3131
brew install dotnet@6
3232
```
3333
* If Gradle cannot find `dotnet`, run `./gradlew --stop` and `./gradlew projects` to reload the daemon. Note that this should be done in your terminal as invoking Gradle through the IDE will use the IDE's cached PATH.
34+
* It is recommended to [launch your IDE from the terminal](https://www.jetbrains.com/help/idea/working-with-the-ide-features-from-command-line.html) due to a known issue with Gradle/Java 21 where the Gradle daemon does not respect your PATH variable when the IDE is started from the desktop/Toolbox.
3435
3536
### Instructions
3637

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
# Toolkit Version
5-
toolkitVersion=3.58-SNAPSHOT
5+
toolkitVersion=3.59-SNAPSHOT
66

77
# Publish Settings
88
publishToken=

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ mockitoKotlin = "5.4.0"
2727
mockk = "1.13.10"
2828
nimbus-jose-jwt = "9.40"
2929
node-gradle = "7.0.2"
30-
telemetryGenerator = "1.0.301"
30+
telemetryGenerator = "1.0.307"
3131
testLogger = "4.0.0"
3232
testRetry = "1.5.10"
3333
# test-only; platform provides slf4j transitively at runtime

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/BrowserConnector.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class BrowserConnector(
6767
it.elementId(source.asText())
6868
}
6969
} else if (module != null && trigger != null) {
70-
Telemetry.toolkit.openModule.use {
70+
Telemetry.toolkit.willOpenModule.use {
7171
it.module(module.asText())
7272
it.source(trigger.asText())
7373
}

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/codescan/CodeWhispererCodeScanSession.kt

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,16 @@ import com.fasterxml.jackson.databind.DeserializationFeature
77
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
88
import com.fasterxml.jackson.module.kotlin.readValue
99
import com.intellij.openapi.application.ApplicationInfo
10-
import com.intellij.openapi.application.ApplicationManager
1110
import com.intellij.openapi.application.runInEdt
1211
import com.intellij.openapi.application.runReadAction
1312
import com.intellij.openapi.fileEditor.FileDocumentManager
1413
import com.intellij.openapi.project.Project
15-
import com.intellij.openapi.project.modules
16-
import com.intellij.openapi.roots.ModuleRootManager
1714
import com.intellij.openapi.vfs.LocalFileSystem
1815
import kotlinx.coroutines.delay
1916
import kotlinx.coroutines.ensureActive
2017
import kotlinx.coroutines.isActive
2118
import kotlinx.coroutines.time.withTimeout
2219
import kotlinx.coroutines.withContext
23-
import migration.software.aws.toolkits.jetbrains.settings.AwsSettings
24-
import org.apache.commons.codec.digest.DigestUtils
2520
import software.amazon.awssdk.services.codewhisperer.model.ArtifactType
2621
import software.amazon.awssdk.services.codewhisperer.model.CodeScanFindingsSchema
2722
import software.amazon.awssdk.services.codewhisperer.model.CodeScanStatus
@@ -38,14 +33,12 @@ import software.aws.toolkits.core.utils.Waiters.waitUntil
3833
import software.aws.toolkits.core.utils.debug
3934
import software.aws.toolkits.core.utils.getLogger
4035
import software.aws.toolkits.core.utils.info
41-
import software.aws.toolkits.core.utils.toHexString
4236
import software.aws.toolkits.jetbrains.services.codewhisperer.codescan.sessionconfig.CodeScanSessionConfig
4337
import software.aws.toolkits.jetbrains.services.codewhisperer.codescan.sessionconfig.PayloadContext
4438
import software.aws.toolkits.jetbrains.services.codewhisperer.credentials.CodeWhispererClientAdaptor
4539
import software.aws.toolkits.jetbrains.services.codewhisperer.explorer.CodeWhispererExplorerActionManager
4640
import software.aws.toolkits.jetbrains.services.codewhisperer.model.CodeScanResponseContext
4741
import software.aws.toolkits.jetbrains.services.codewhisperer.model.CreateUploadUrlServiceInvocationContext
48-
import software.aws.toolkits.jetbrains.services.codewhisperer.telemetry.CodeWhispererTelemetryService
4942
import software.aws.toolkits.jetbrains.services.codewhisperer.util.CodeWhispererConstants
5043
import software.aws.toolkits.jetbrains.services.codewhisperer.util.CodeWhispererConstants.CODE_SCAN_POLLING_INTERVAL_IN_SECONDS
5144
import software.aws.toolkits.jetbrains.services.codewhisperer.util.CodeWhispererConstants.FILE_SCANS_THROTTLING_MESSAGE
@@ -59,14 +52,12 @@ import software.aws.toolkits.jetbrains.services.codewhisperer.util.CodeWhisperer
5952
import software.aws.toolkits.jetbrains.services.codewhisperer.util.getTelemetryErrorMessage
6053
import software.aws.toolkits.jetbrains.utils.assertIsNonDispatchThread
6154
import software.aws.toolkits.resources.message
62-
import software.aws.toolkits.telemetry.CodewhispererCodeScanScope
6355
import software.aws.toolkits.telemetry.CodewhispererLanguage
6456
import java.nio.file.Path
6557
import java.time.Duration
6658
import java.time.Instant
6759
import java.util.UUID
6860
import kotlin.coroutines.coroutineContext
69-
import kotlin.io.path.pathString
7061

7162
class CodeWhispererCodeScanSession(val sessionContext: CodeScanSessionContext) {
7263
private val clientToken: UUID = UUID.randomUUID()
@@ -112,7 +103,7 @@ class CodeWhispererCodeScanSession(val sessionContext: CodeScanSessionContext) {
112103
// 2 & 3. CreateUploadURL and upload the context.
113104
currentCoroutineContext.ensureActive()
114105
val artifactsUploadStartTime = now()
115-
val codeScanName = generateScanName()
106+
val codeScanName = UUID.randomUUID().toString()
116107

117108
val taskType = if (isAutoScan()) {
118109
CodeWhispererConstants.UploadTaskType.SCAN_FILE
@@ -375,26 +366,6 @@ class CodeWhispererCodeScanSession(val sessionContext: CodeScanSessionContext) {
375366
private fun isAutoScan(): Boolean =
376367
sessionContext.codeAnalysisScope == CodeWhispererConstants.CodeAnalysisScope.FILE && !sessionContext.sessionConfig.isInitiatedByChat()
377368

378-
private fun generateScanName(): String {
379-
val clientId = AwsSettings.getInstance().clientId
380-
val filePath = sessionContext.sessionConfig.getSelectedFile()?.toNioPath()?.pathString
381-
val scope = CodeWhispererTelemetryService.getInstance().mapToTelemetryScope(
382-
sessionContext.codeAnalysisScope,
383-
sessionContext.sessionConfig.isInitiatedByChat()
384-
)
385-
val projectId = if (scope != CodewhispererCodeScanScope.PROJECT && filePath != null) {
386-
filePath
387-
} else {
388-
ApplicationManager.getApplication().runReadAction<String> {
389-
sessionContext.project.modules.map { module ->
390-
ModuleRootManager.getInstance(module).contentRoots.firstOrNull()?.path
391-
}.joinToString(",")
392-
}
393-
}
394-
395-
return DigestUtils.sha256("$clientId::$projectId::$scope").toHexString()
396-
}
397-
398369
companion object {
399370
private val LOG = getLogger<CodeWhispererCodeScanSession>()
400371
private val MAPPER = jacksonObjectMapper()

0 commit comments

Comments
 (0)