Skip to content

Commit d1f4d36

Browse files
committed
fixing telemetry for skip tests too
1 parent 0f9226e commit d1f4d36

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

packages/core/src/amazonqGumby/chat/controller/controller.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -411,19 +411,20 @@ export class GumbyController {
411411
}
412412

413413
private async handleSkipTestsSelection(message: any) {
414-
const skipTestsSelection = message.formSelectedValues['GumbyTransformSkipTestsForm']
415-
if (skipTestsSelection === CodeWhispererConstants.skipUnitTestsMessage) {
416-
transformByQState.setCustomBuildCommand(CodeWhispererConstants.skipUnitTestsBuildCommand)
417-
} else {
418-
transformByQState.setCustomBuildCommand(CodeWhispererConstants.doNotSkipUnitTestsBuildCommand)
419-
}
420-
telemetry.codeTransform_submitSelection.emit({
421-
codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId(),
422-
userChoice: skipTestsSelection,
423-
result: MetadataResult.Pass,
414+
await telemetry.codeTransform_submitSelection.run(async () => {
415+
const skipTestsSelection = message.formSelectedValues['GumbyTransformSkipTestsForm']
416+
if (skipTestsSelection === CodeWhispererConstants.skipUnitTestsMessage) {
417+
transformByQState.setCustomBuildCommand(CodeWhispererConstants.skipUnitTestsBuildCommand)
418+
} else {
419+
transformByQState.setCustomBuildCommand(CodeWhispererConstants.doNotSkipUnitTestsBuildCommand)
420+
}
421+
telemetry.record({
422+
codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId(),
423+
userChoice: skipTestsSelection,
424+
})
425+
this.messenger.sendSkipTestsSelectionMessage(skipTestsSelection, message.tabID)
426+
await this.messenger.sendOneOrMultipleDiffsPrompt(message.tabID)
424427
})
425-
this.messenger.sendSkipTestsSelectionMessage(skipTestsSelection, message.tabID)
426-
await this.messenger.sendOneOrMultipleDiffsPrompt(message.tabID)
427428
}
428429

429430
private async handleOneOrMultipleDiffs(message: any) {
@@ -438,7 +439,6 @@ export class GumbyController {
438439
telemetry.record({
439440
codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId(),
440441
userChoice: oneOrMultipleDiffsSelection,
441-
result: MetadataResult.Pass,
442442
})
443443

444444
this.messenger.sendOneOrMultipleDiffsMessage(oneOrMultipleDiffsSelection, message.tabID)

0 commit comments

Comments
 (0)