Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions packages/core/src/amazonqGumby/chat/controller/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import {
CodeTransformJavaTargetVersionsAllowed,
CodeTransformJavaSourceVersionsAllowed,
} from '../../../shared/telemetry/telemetry'
import { MetadataResult } from '../../../shared/telemetry/telemetryClient'
import { CodeTransformTelemetryState } from '../../telemetry/codeTransformTelemetryState'
import DependencyVersions from '../../models/dependencies'
import { getStringHash } from '../../../shared/utilities/textUtilities'
Expand Down Expand Up @@ -364,15 +363,16 @@ export class GumbyController {
await this.handleUserLanguageUpgradeProjectChoice(message)
break
case ButtonActions.CANCEL_TRANSFORMATION_FORM:
telemetry.codeTransform_submitSelection.emit({
codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId(),
userChoice: 'Cancel',
result: MetadataResult.Pass,
})
this.transformationFinished({
message: CodeWhispererConstants.jobCancelledChatMessage,
tabID: message.tabID,
includeStartNewTransformationButton: true,
telemetry.codeTransform_submitSelection.run(() => {
telemetry.record({
codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId(),
userChoice: 'Cancel',
})
this.transformationFinished({
message: CodeWhispererConstants.jobCancelledChatMessage,
tabID: message.tabID,
includeStartNewTransformationButton: true,
})
})
break
case ButtonActions.CONFIRM_SKIP_TESTS_FORM:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { ExportResultArchiveStructure, downloadExportResultArchive } from '../..
import { getLogger } from '../../../shared/logger'
import { telemetry } from '../../../shared/telemetry/telemetry'
import { CodeTransformTelemetryState } from '../../../amazonqGumby/telemetry/codeTransformTelemetryState'
import { MetadataResult } from '../../../shared/telemetry/telemetryClient'
import * as CodeWhispererConstants from '../../models/constants'
import { createCodeWhispererChatStreamingClient } from '../../../shared/clients/codewhispererChatClient'
import { ChatSessionManager } from '../../../amazonqGumby/chat/storages/chatSession'
Expand Down Expand Up @@ -532,11 +531,13 @@ export class ProposedTransformationExplorer {
})

vscode.commands.registerCommand('aws.amazonq.transformationHub.reviewChanges.acceptChanges', async () => {
diffModel.saveChanges()
telemetry.codeTransform_submitSelection.emit({
codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId(),
codeTransformJobId: transformByQState.getJobId(),
userChoice: `acceptChanges-${patchFilesDescriptions?.content[diffModel.currentPatchIndex].name}`,
telemetry.codeTransform_submitSelection.run(() => {
diffModel.saveChanges()
telemetry.record({
codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId(),
codeTransformJobId: transformByQState.getJobId(),
userChoice: `acceptChanges-${patchFilesDescriptions?.content[diffModel.currentPatchIndex].name}`,
})
})
if (transformByQState.getMultipleDiffs()) {
void vscode.window.showInformationMessage(
Expand Down Expand Up @@ -580,35 +581,21 @@ export class ProposedTransformationExplorer {
// All patches have been applied, reset the state
await reset()
}

telemetry.codeTransform_viewArtifact.emit({
codeTransformArtifactType: 'ClientInstructions',
codeTransformVCSViewerSrcComponents: 'toastNotification',
codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId(),
codeTransformJobId: transformByQState.getJobId(),
codeTransformStatus: transformByQState.getStatus(),
userChoice: 'Submit',
result: MetadataResult.Pass,
})
})

vscode.commands.registerCommand('aws.amazonq.transformationHub.reviewChanges.rejectChanges', async () => {
diffModel.rejectChanges()
await reset()

await telemetry.codeTransform_submitSelection.run(async () => {
diffModel.rejectChanges()
await reset()
telemetry.record({
codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId(),
codeTransformJobId: transformByQState.getJobId(),
userChoice: 'rejectChanges',
})
})
transformByQState.getChatControllers()?.transformationFinished.fire({
tabID: ChatSessionManager.Instance.getSession().tabID,
})

telemetry.codeTransform_viewArtifact.emit({
codeTransformArtifactType: 'ClientInstructions',
codeTransformVCSViewerSrcComponents: 'toastNotification',
codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId(),
codeTransformJobId: transformByQState.getJobId(),
codeTransformStatus: transformByQState.getStatus(),
userChoice: 'Cancel',
result: MetadataResult.Pass,
})
Copy link
Contributor Author

@dhasani23 dhasani23 Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and above, viewArtifact isn't necessary since we already have submitSelection

aws-toolkit-common package PR to remove viewArtifact will be out shortly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

})
}
}
Loading