Skip to content

Commit

Permalink
Adding credentialUrl to differentiate the Internal Users vs External …
Browse files Browse the repository at this point in the history
…users (#5159)
  • Loading branch information
laileni-aws authored Dec 3, 2024
1 parent 2eb3c14 commit 5b14a02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import software.aws.toolkits.jetbrains.services.codemodernizer.utils.calculateTo
import software.aws.toolkits.jetbrains.services.codewhisperer.codetest.sessionconfig.CodeTestSessionConfig
import software.aws.toolkits.jetbrains.services.codewhisperer.credentials.CodeWhispererClientAdaptor
import software.aws.toolkits.jetbrains.services.codewhisperer.util.CodeWhispererUtil.promptReAuth
import software.aws.toolkits.jetbrains.services.cwc.controller.chat.telemetry.getStartUrl
import software.aws.toolkits.jetbrains.services.cwc.messages.ChatMessageType
import software.aws.toolkits.jetbrains.services.cwc.messages.CodeReference
import software.aws.toolkits.jetbrains.settings.CodeWhispererSettings
Expand Down Expand Up @@ -511,6 +512,7 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
cwsprChatProgrammingLanguage = session.programmingLanguage.languageId,
hasUserPromptSupplied = session.hasUserPromptSupplied,
isSupportedLanguage = true,
credentialStartUrl = getStartUrl(project),
jobGroup = session.testGenerationJobGroupName,
jobId = session.testGenerationJob,
result = if (e.message == message("testgen.message.cancelled")) MetricResult.Cancelled else MetricResult.Failed,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ import software.aws.toolkits.jetbrains.services.cwc.clients.chat.model.TriggerTy
import software.aws.toolkits.jetbrains.services.cwc.clients.chat.v1.ChatSessionV1.Companion.validLanguages
import software.aws.toolkits.jetbrains.services.cwc.controller.chat.StaticPrompt
import software.aws.toolkits.jetbrains.services.cwc.controller.chat.StaticTextResponse
import software.aws.toolkits.jetbrains.services.cwc.controller.chat.telemetry.getStartUrl
import software.aws.toolkits.jetbrains.services.cwc.editor.context.ActiveFileContext
import software.aws.toolkits.jetbrains.services.cwc.editor.context.ActiveFileContextExtractor
import software.aws.toolkits.jetbrains.services.cwc.editor.context.ExtractionTriggerType
Expand Down Expand Up @@ -285,6 +286,7 @@ class CodeTestChatController(
cwsprChatProgrammingLanguage = session.programmingLanguage.languageId,
hasUserPromptSupplied = session.hasUserPromptSupplied,
isSupportedLanguage = false,
credentialStartUrl = getStartUrl(project),
result = MetricResult.Succeeded,
perfClientLatency = (Instant.now().toEpochMilli() - session.startTimeOfTestGeneration)
)
Expand Down Expand Up @@ -583,6 +585,7 @@ class CodeTestChatController(
cwsprChatProgrammingLanguage = session.programmingLanguage.languageId,
hasUserPromptSupplied = session.hasUserPromptSupplied,
isSupportedLanguage = true,
credentialStartUrl = getStartUrl(project = context.project),
jobGroup = session.testGenerationJobGroupName,
jobId = session.testGenerationJob,
acceptedCount = session.numberOfUnitTestCasesGenerated?.toLong(),
Expand Down Expand Up @@ -775,6 +778,7 @@ class CodeTestChatController(
cwsprChatProgrammingLanguage = session.programmingLanguage.languageId,
hasUserPromptSupplied = session.hasUserPromptSupplied,
isSupportedLanguage = true,
credentialStartUrl = getStartUrl(project = context.project),
jobGroup = session.testGenerationJobGroupName,
jobId = session.testGenerationJob,
acceptedCount = 0,
Expand Down

0 comments on commit 5b14a02

Please sign in to comment.