Skip to content

Commit c9f1491

Browse files
authored
Merge branch 'aws:main' into add-generate-tests
2 parents 3124e9a + 85fd157 commit c9f1491

File tree

41 files changed

+400
-178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+400
-178
lines changed

.changes/3.29.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"date" : "2024-09-19",
3+
"version" : "3.29",
4+
"entries" : [ {
5+
"type" : "feature",
6+
"description" : "Support `@workspace` queries for specific files like \"`@workspace` what does test.ts do?\". "
7+
}, {
8+
"type" : "bugfix",
9+
"description" : "Amazon Q Feature Dev: fix iteration count messaging during code insertion"
10+
}, {
11+
"type" : "bugfix",
12+
"description" : "Fix UI slowdown when Amazon Q Inline Suggestions are enabled, but token cannot be refreshed (#4868)"
13+
}, {
14+
"type" : "bugfix",
15+
"description" : "Fix \"read access\" error that may occur when Amazon Q Inline Suggestion is building context (#4888) (#4848)"
16+
} ]
17+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Amazon Q Code Transformation: notify users when no JDK is set in Project Structure settings"
4+
}

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# _3.29_ (2024-09-19)
2+
- **(Feature)** Support `@workspace` queries for specific files like "`@workspace` what does test.ts do?".
3+
- **(Bug Fix)** Amazon Q Feature Dev: fix iteration count messaging during code insertion
4+
- **(Bug Fix)** Fix UI slowdown when Amazon Q Inline Suggestions are enabled, but token cannot be refreshed ([#4868](https://github.com/aws/aws-toolkit-jetbrains/issues/4868))
5+
- **(Bug Fix)** Fix "read access" error that may occur when Amazon Q Inline Suggestion is building context ([#4888](https://github.com/aws/aws-toolkit-jetbrains/issues/4888)) ([#4848](https://github.com/aws/aws-toolkit-jetbrains/issues/4848))
6+
17
# _3.28_ (2024-09-11)
28
- **(Feature)** Improve workspace indexing by only index files that are changed since last indexing
39
- **(Bug Fix)** Amazon Q Chat: Fixed inline code blocks are not vertically aligned with texts

detekt-rules/src/software/aws/toolkits/gradle/detekt/rules/BannedImportsRule.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ class BannedImportsRule : Rule() {
5050
)
5151
}
5252

53+
if (importedFqName?.startsWith("org.gradle.internal.impldep") == true) {
54+
report(
55+
CodeSmell(
56+
issue,
57+
Entity.from(element),
58+
message = "Avoid using Gradle's internal implementation classes: not public API and may change without notice."
59+
)
60+
)
61+
}
62+
5363
if (importedFqName?.contains("kotlinx.coroutines.Dispatchers") == true) {
5464
report(
5565
CodeSmell(

detekt-rules/tst/software/aws/toolkits/gradle/detekt/rules/BannedImportsRuleTest.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ class BannedImportsRuleTest {
5151
assertThat(rule.lint("import org.assertj.core.api.Assertions.assertThat")).isEmpty()
5252
}
5353

54+
@Test
55+
fun `Importing Gradle internal implementation classes fails`() {
56+
assertThat(rule.lint("import org.gradle.internal.impldep"))
57+
.singleElement()
58+
.matches {
59+
it.id == "BannedImports" && it.message == "Avoid using Gradle's internal implementation classes: not public API and may change without notice."
60+
}
61+
}
62+
5463
@Test
5564
fun `Importing Dispatchers fails`() {
5665
assertThat(rule.lint("import kotlinx.coroutines.Dispatchers"))

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.29-SNAPSHOT
5+
toolkitVersion=3.30-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
@@ -25,7 +25,7 @@ mockitoKotlin = "5.4.0"
2525
mockk = "1.13.10"
2626
nimbus-jose-jwt = "9.40"
2727
node-gradle = "7.0.2"
28-
telemetryGenerator = "1.0.250"
28+
telemetryGenerator = "1.0.259"
2929
testLogger = "4.0.0"
3030
testRetry = "1.5.10"
3131
# test-only; platform provides slf4j transitively at runtime

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/controller/FeatureDevController.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,6 @@ class FeatureDevController(
335335
)
336336
)
337337

338-
// Ensure that chat input is enabled so that customers can iterate over code generation if they choose to do so
339-
messenger.sendChatInputEnabledMessage(tabId = tabId, enabled = true)
340338
messenger.sendUpdatePlaceholder(
341339
tabId = tabId,
342340
newPlaceholder = message("amazonqFeatureDev.placeholder.additional_improvements")
@@ -353,7 +351,13 @@ class FeatureDevController(
353351
}
354352

355353
private suspend fun newTask(tabId: String) {
356-
closeSession(tabId)
354+
val session = getSessionInfo(tabId)
355+
val sessionLatency = System.currentTimeMillis() - session.sessionStartTime
356+
AmazonqTelemetry.endChat(
357+
amazonqConversationId = session.conversationId,
358+
amazonqEndOfTheConversationLatency = sessionLatency.toDouble(),
359+
credentialStartUrl = getStartUrl(project = context.project)
360+
)
357361
chatSessionStorage.deleteSession(tabId)
358362

359363
newTabOpened(tabId)

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/controller/FeatureDevControllerExtensions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ suspend fun FeatureDevController.onCodeGeneration(session: Session, message: Str
100100
tabId = tabId,
101101
messageType = FeatureDevMessageType.Answer,
102102
message = if (remainingIterations == 0) {
103+
message("amazonqFeatureDev.code_generation.iteration_zero")
104+
} else {
103105
message(
104106
"amazonqFeatureDev.code_generation.iteration_counts",
105107
remainingIterations,
106108
totalIterations
107109
)
108-
} else {
109-
message("amazonqFeatureDev.code_generation.iteration_zero")
110110
}
111111
)
112112
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/controller/chat/messenger/ChatPromptHandler.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ class ChatPromptHandler(private val telemetryHelper: TelemetryHelper) {
9292
ChatMessage(tabId = tabId, triggerId = triggerId, messageId = requestId, messageType = ChatMessageType.Answer, followUps = followUps)
9393

9494
telemetryHelper.setResponseStreamTotalTime(tabId)
95+
telemetryHelper.setResponseHasProjectContext(
96+
requestId,
97+
telemetryHelper.getIsProjectContextEnabled() && data.useRelevantDocuments && data.relevantTextDocuments.isNotEmpty()
98+
)
9599
telemetryHelper.recordAddMessage(data, response, responseText.length, statusCode, countTotalNumberOfCodeBlocks(responseText))
96100
emit(response)
97101
}

0 commit comments

Comments
 (0)