From 382114e9f28ec04d2470be378bcd2f3cf32e8448 Mon Sep 17 00:00:00 2001 From: Laxman Reddy <141967714+laileni-aws@users.noreply.github.com> Date: Fri, 6 Dec 2024 10:30:35 -0800 Subject: [PATCH] Telemetry: UTG send plaintext instead of python in amazonq_utgGenerateTests event --- packages/core/src/amazonqTest/chat/controller/controller.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/core/src/amazonqTest/chat/controller/controller.ts b/packages/core/src/amazonqTest/chat/controller/controller.ts index 065eeb70297..a7938575a9b 100644 --- a/packages/core/src/amazonqTest/chat/controller/controller.ts +++ b/packages/core/src/amazonqTest/chat/controller/controller.ts @@ -444,9 +444,8 @@ export class TestController { /* For Re:Invent 2024 we are supporting only java and python for unit test generation, rest of the languages shows the similar experience as CWC - If user request test generation from input chat without opening a file, its difficult to get the language, so default will be plainText */ - if (language !== 'java' && language !== 'python' && language !== 'plaintext') { + if (language !== 'java' && language !== 'python') { const unsupportedLanguage = language.charAt(0).toUpperCase() + language.slice(1) let unsupportedMessage = `I'm sorry, but /test only supports Python and Java
While ${unsupportedLanguage} is not supported, I will generate a suggestion below. ` // handle the case when language is undefined @@ -640,7 +639,6 @@ export class TestController { const session = this.sessionStorage.getSession() session.acceptedJobId = session.listOfTestGenerationJobId[session.listOfTestGenerationJobId.length - 1] const filePath = session.generatedFilePath - session.fileLanguage = await this.getLanguageForFilePath(filePath) const absolutePath = path.join(session.projectRootPath, filePath) const fileExists = await fs.existsFile(absolutePath) const buildCommand = session.updatedBuildCommands?.join(' ') @@ -724,7 +722,7 @@ export class TestController { acceptedCharactersCount: session.charsOfCodeAccepted, generatedLinesCount: session.linesOfCodeGenerated, acceptedLinesCount: session.linesOfCodeAccepted, - cwsprChatProgrammingLanguage: session.fileLanguage, + cwsprChatProgrammingLanguage: session.fileLanguage ?? 'plaintext', jobId: session.listOfTestGenerationJobId[0], // For RIV, UTG does only one StartTestGeneration API call so jobId = session.listOfTestGenerationJobId[0] jobGroup: session.testGenerationJobGroupName, buildPayloadBytes: session.srcPayloadSize,