Skip to content

Commit e4d1527

Browse files
committed
test removal of telemetry
1 parent f49b911 commit e4d1527

File tree

2 files changed

+31
-19
lines changed

2 files changed

+31
-19
lines changed

packages/core/src/codewhisperer/commands/basicCommands.ts

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -374,25 +374,29 @@ export const openSecurityIssuePanel = Commands.declare(
374374
console.log('in show securityIssueWebview')
375375
console.log('targetIssue', targetIssue)
376376
console.log('file Path', filePath)
377-
378-
telemetry.codewhisperer_codeScanIssueViewDetails.emit({
379-
findingId: targetIssue.findingId,
380-
detectorId: targetIssue.detectorId,
381-
ruleId: targetIssue.ruleId,
382-
credentialStartUrl: AuthUtil.instance.startUrl,
383-
autoDetected: targetIssue.autoDetected,
384-
})
385-
TelemetryHelper.instance.sendCodeScanRemediationsEvent(
386-
undefined,
387-
'CODESCAN_ISSUE_VIEW_DETAILS',
388-
targetIssue.detectorId,
389-
targetIssue.findingId,
390-
targetIssue.ruleId,
391-
undefined,
392-
undefined,
393-
undefined,
394-
!!targetIssue.suggestedFixes.length
395-
)
377+
console.log('before', targetIssue.suggestedFixes.length === 0)
378+
379+
// telemetry.codewhisperer_codeScanIssueViewDetails.emit({
380+
// findingId: targetIssue.findingId,
381+
// detectorId: targetIssue.detectorId,
382+
// ruleId: targetIssue.ruleId,
383+
// credentialStartUrl: AuthUtil.instance.startUrl,
384+
// autoDetected: targetIssue.autoDetected,
385+
// })
386+
console.log('middle', targetIssue.suggestedFixes.length === 0)
387+
388+
// TelemetryHelper.instance.sendCodeScanRemediationsEvent(
389+
// undefined,
390+
// 'CODESCAN_ISSUE_VIEW_DETAILS',
391+
// targetIssue.detectorId,
392+
// targetIssue.findingId,
393+
// targetIssue.ruleId,
394+
// undefined,
395+
// undefined,
396+
// undefined,
397+
// !!targetIssue.suggestedFixes.length
398+
// )
399+
console.log('after', targetIssue.suggestedFixes.length === 0)
396400
if (targetIssue.suggestedFixes.length === 0) {
397401
console.log('going to generate fix as suggested fix length is 0')
398402
await generateFix.execute(targetIssue, targetFilePath, 'webview', true, false)

packages/core/src/codewhisperer/util/telemetryHelper.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,8 @@ export class TelemetryHelper {
877877
result?: string,
878878
includesFix?: boolean
879879
) {
880+
// eslint-disable-next-line aws-toolkits/no-console-log
881+
console.log('sending telemetry')
880882
client
881883
.sendTelemetryEvent({
882884
telemetryEvent: {
@@ -907,6 +909,12 @@ export class TelemetryHelper {
907909
if (isAwsError(error)) {
908910
requestId = error.requestId
909911
}
912+
// eslint-disable-next-line aws-toolkits/no-console-log
913+
console.log(
914+
`Failed to sendCodeScanRemediationsEvent to CodeWhisperer, requestId: ${
915+
requestId ?? ''
916+
}, message: ${error.message}`
917+
)
910918
getLogger().debug(
911919
`Failed to sendCodeScanRemediationsEvent to CodeWhisperer, requestId: ${
912920
requestId ?? ''

0 commit comments

Comments
 (0)