Skip to content

Commit 84062da

Browse files
committed
addressed comment
1 parent 9151dce commit 84062da

File tree

4 files changed

+7
-80
lines changed

4 files changed

+7
-80
lines changed

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/controller/CodeTestChatController.kt

Lines changed: 5 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -813,11 +813,7 @@ class CodeTestChatController(
813813
generatedLinesCount = session.linesOfCodeGenerated?.toLong(),
814814
acceptedCharactersCount = session.charsOfCodeGenerated?.toLong(),
815815
generatedCharactersCount = session.charsOfCodeGenerated?.toLong(),
816-
result = if (buildResult) {
817-
MetricResult.Succeeded
818-
} else {
819-
MetricResult.Failed
820-
},
816+
result = MetricResult.Failed,
821817
perfClientLatency = session.latencyOfTestGeneration,
822818
isCodeBlockSelected = session.isCodeBlockSelected,
823819
artifactsUploadDuration = session.artifactUploadDuration,
@@ -930,11 +926,7 @@ class CodeTestChatController(
930926
generatedLinesCount = session.linesOfCodeGenerated?.toLong(),
931927
acceptedCharactersCount = 0,
932928
generatedCharactersCount = session.charsOfCodeGenerated?.toLong(),
933-
result = if (buildResult) {
934-
MetricResult.Succeeded
935-
} else {
936-
MetricResult.Failed
937-
},
929+
result = MetricResult.Succeeded,
938930
perfClientLatency = session.latencyOfTestGeneration,
939931
isCodeBlockSelected = session.isCodeBlockSelected,
940932
artifactsUploadDuration = session.artifactUploadDuration,
@@ -968,11 +960,7 @@ class CodeTestChatController(
968960
generatedLinesCount = session.linesOfCodeGenerated?.toLong(),
969961
acceptedCharactersCount = session.charsOfCodeGenerated?.toLong(),
970962
generatedCharactersCount = session.charsOfCodeGenerated?.toLong(),
971-
result = if (buildResult) {
972-
MetricResult.Succeeded
973-
} else {
974-
MetricResult.Failed
975-
},
963+
result = MetricResult.Failed,
976964
perfClientLatency = session.latencyOfTestGeneration,
977965
isCodeBlockSelected = session.isCodeBlockSelected,
978966
artifactsUploadDuration = session.artifactUploadDuration,
@@ -1030,7 +1018,6 @@ class CodeTestChatController(
10301018
canBeVoted = false
10311019
)
10321020
)
1033-
buildResult = true
10341021
AmazonqTelemetry.unitTestGeneration(
10351022
count = session.iteration.toLong() - 1,
10361023
cwsprChatProgrammingLanguage = session.programmingLanguage.languageId,
@@ -1045,11 +1032,7 @@ class CodeTestChatController(
10451032
generatedLinesCount = session.linesOfCodeGenerated?.toLong(),
10461033
acceptedCharactersCount = session.charsOfCodeGenerated?.toLong(),
10471034
generatedCharactersCount = session.charsOfCodeGenerated?.toLong(),
1048-
result = if (buildResult) {
1049-
MetricResult.Succeeded
1050-
} else {
1051-
MetricResult.Failed
1052-
},
1035+
result = MetricResult.Succeeded,
10531036
perfClientLatency = session.latencyOfTestGeneration,
10541037
isCodeBlockSelected = session.isCodeBlockSelected,
10551038
artifactsUploadDuration = session.artifactUploadDuration,
@@ -1091,60 +1074,7 @@ class CodeTestChatController(
10911074

10921075
return
10931076
}
1094-
// taskContext.progressStatus = BuildAndExecuteProgressStatus.RUN_EXECUTION_TESTS
1095-
// updateBuildAndExecuteProgressCard(taskContext.progressStatus, messageId, session.iteration)
1096-
//
1097-
// val testLogsFile = VirtualFileManager.getInstance().findFileByNioPath(
1098-
// withContext(currentCoroutineContext()) {
1099-
// Files.createTempFile(null, null)
1100-
// }
1101-
// )
1102-
// if (testLogsFile == null) {
1103-
// // TODO: handle no log file case
1104-
// return
1105-
// }
1106-
// LOG.debug {
1107-
// "Q TestGen session: ${codeTestChatHelper.getActiveCodeTestTabId()}: " +
1108-
// "tmpFile for test logs:\n ${buildLogsFile.path}"
1109-
// }
1110-
// delay(1000)
1111-
// runBuildOrTestCommand(taskContext.executionCommand, testLogsFile, context.project, isBuildCommand = false, taskContext)
1112-
// while (taskContext.testExitCode < 0) {
1113-
// // wait until test command finished
1114-
// delay(1000)
1115-
// }
1116-
//
1117-
// if (taskContext.testExitCode == 0) {
1118-
// taskContext.progressStatus = BuildAndExecuteProgressStatus.TESTS_EXECUTED
1119-
// updateBuildAndExecuteProgressCard(taskContext.progressStatus, messageId, session.iteration)
1120-
// codeTestChatHelper.addAnswer(
1121-
// CodeTestChatMessageContent(
1122-
// message = message("testgen.message.success"),
1123-
// type = ChatMessageType.Answer,
1124-
// canBeVoted = false
1125-
// )
1126-
// )
1127-
// // sessionCleanUp(message.tabId)
1128-
// return
1129-
// }
1130-
//
1131-
// // has test failure, we will zip the latest project and invoke backend again
1132-
// taskContext.progressStatus = BuildAndExecuteProgressStatus.FIXING_TEST_CASES
1133-
// val buildAndExecuteMessageId = updateBuildAndExecuteProgressCard(taskContext.progressStatus, messageId, session.iteration)
1134-
//
1135-
// val previousUTGIterationContext = PreviousUTGIterationContext(
1136-
// buildLogFile = buildLogsFile,
1137-
// testLogFile = testLogsFile,
1138-
// selectedFile = session.selectedFile,
1139-
// buildAndExecuteMessageId = buildAndExecuteMessageId
1140-
// )
1141-
//
1142-
// val job = CodeWhispererUTGChatManager.getInstance(context.project).generateTests("", codeTestChatHelper, previousUTGIterationContext, null)
1143-
// job?.join()
1144-
//
1145-
// taskContext.progressStatus = BuildAndExecuteProgressStatus.PROCESS_TEST_RESULTS
1146-
// // session.iteration already updated in generateTests
1147-
// updateBuildAndExecuteProgressCard(taskContext.progressStatus, messageId, session.iteration - 1)
1077+
// TO-DO ADD execute loop in the furture
11481078
}
11491079
"utg_modify_command" -> {
11501080
// TODO allow user input to modify the command

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/codetest/sessionconfig/CodeTestSessionConfig.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,6 @@ class CodeTestSessionConfig(
166166
if (buildAndExecuteLogFile != null) {
167167
val buildLogFilePath = Path.of(utgDir, buildAndExecuteLogDir, "buildAndExecuteLog")
168168
.toString().replace("\\", "/") // Ensures consistent path format
169-
170-
LOG.debug { "Adding build logs to ZIP at: $buildLogFilePath" }
171169
it.putNextEntry(buildLogFilePath, buildAndExecuteLogFile.inputStream)
172170
}
173171
if (payloadMetadata.payloadLimitCrossed == true) {

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/util/CodeWhispererConstants.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package software.aws.toolkits.jetbrains.services.codewhisperer.util
66
import com.intellij.openapi.actionSystem.DataKey
77
import com.intellij.openapi.editor.markup.EffectType
88
import com.intellij.openapi.editor.markup.TextAttributes
9-
import com.intellij.openapi.util.registry.Registry
109
import com.intellij.ui.JBColor
1110
import software.amazon.awssdk.regions.Region
1211
import software.amazon.awssdk.services.codewhispererruntime.model.AccessDeniedException
@@ -155,7 +154,7 @@ object CodeWhispererConstants {
155154

156155
object Config {
157156
val CODEWHISPERER_ENDPOINT
158-
get() = Registry.get("amazon.q.endpoint").asString()
157+
get() = "https://rts.gamma-us-east-1.codewhisperer.ai.aws.dev/"
159158

160159
const val CODEWHISPERER_IDPOOL_ID = "us-east-1:70717e99-906f-4add-908c-bd9074a2f5b9"
161160
val Sigv4ClientRegion = Region.US_EAST_1

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2077,8 +2077,8 @@ testgen.placeholder.newtab=Ask any coding question or type \u0022/\u0022 for act
20772077
testgen.placeholder.select_an_option = Please select an action to proceed (Accept or Reject)
20782078
testgen.placeholder.view_diff=Select View Diff to see the generated unit tests
20792079
testgen.placeholder.waiting_on_your_inputs=Waiting on your inputs...
2080-
testgen.progressbar.generate_unit_tests=Generating unit tests...
20812080
testgen.progressbar.build_and_execute=Fixing test errors...
2081+
testgen.progressbar.generate_unit_tests=Generating unit tests...
20822082
toolkit.login.aws_builder_id.already_connected.cancel=Use existing AWS Builder ID
20832083
toolkit.login.aws_builder_id.already_connected.message=You already signed in with an AWS Builder ID.\nSign out to add another?
20842084
toolkit.login.aws_builder_id.already_connected.reconnect=Sign out

0 commit comments

Comments
 (0)