From cfc6099eaf040c288501470e997b6208c68a9886 Mon Sep 17 00:00:00 2001 From: Will Lo <96078566+Will-ShaoHua@users.noreply.github.com> Date: Wed, 14 Aug 2024 11:11:17 -0700 Subject: [PATCH] fix(telemetry): bump toolkit telemetry generator version (#5450) * bump toolkit telemetry version * patch * patch * patch lock file * fix test compile error * use 0 instead of -1 as the default value before we figureout the modified character length --- package-lock.json | 9 +++++---- .../codewhisperer/tracker/codewhispererTracker.test.ts | 2 ++ packages/core/package.json | 2 +- .../service/transformByQ/humanInTheLoopManager.ts | 1 - .../service/transformByQ/transformApiHandler.ts | 1 - .../src/codewhisperer/tracker/codewhispererTracker.ts | 2 ++ 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 35f863b2d2d..fce4cca16b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3287,9 +3287,10 @@ } }, "node_modules/@aws-toolkits/telemetry": { - "version": "1.0.232", - "resolved": "https://registry.npmjs.org/@aws-toolkits/telemetry/-/telemetry-1.0.232.tgz", - "integrity": "sha512-JZ4m24rv+LTQW4FBXcy7Jyf3m2K78e5vV1ehgHM2nr5AianZREOlC3EMZYfkTyjUBriG10UY9ET9PZjcvYl3XA==", + "version": "1.0.239", + "resolved": "https://registry.npmjs.org/@aws-toolkits/telemetry/-/telemetry-1.0.239.tgz", + "integrity": "sha512-vnx4mzVbE63zUvXzcA3gju4784X43W1C8xE/znkZYXjFrNVz8QEWXSpKRt3idQptpyaB/xIU1bQUIM3c9n61SA==", + "license": "Apache-2.0", "dependencies": { "ajv": "^6.12.6", "fs-extra": "^11.1.0", @@ -18890,7 +18891,7 @@ }, "devDependencies": { "@aws-sdk/types": "^3.13.1", - "@aws-toolkits/telemetry": "^1.0.216", + "@aws-toolkits/telemetry": "^1.0.236", "@aws/fully-qualified-names": "^2.1.4", "@cspotcode/source-map-support": "^0.8.1", "@sinonjs/fake-timers": "^10.0.2", diff --git a/packages/amazonq/test/unit/codewhisperer/tracker/codewhispererTracker.test.ts b/packages/amazonq/test/unit/codewhisperer/tracker/codewhispererTracker.test.ts index 1f53be09449..8fc7e76257c 100644 --- a/packages/amazonq/test/unit/codewhisperer/tracker/codewhispererTracker.test.ts +++ b/packages/amazonq/test/unit/codewhisperer/tracker/codewhispererTracker.test.ts @@ -115,6 +115,8 @@ describe('codewhispererTracker', function () { codewhispererLanguage: 'java', credentialStartUrl: testStartUrl, codewhispererUserGroup: 'CrossFile', + codewhispererCharactersAccepted: suggestion.originalString.length, + codewhispererCharactersModified: 0, }) }) }) diff --git a/packages/core/package.json b/packages/core/package.json index cd6e8e7074e..b6a92ed9ddc 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -4044,7 +4044,7 @@ }, "devDependencies": { "@aws-sdk/types": "^3.13.1", - "@aws-toolkits/telemetry": "^1.0.216", + "@aws-toolkits/telemetry": "^1.0.236", "@aws/fully-qualified-names": "^2.1.4", "@cspotcode/source-map-support": "^0.8.1", "@sinonjs/fake-timers": "^10.0.2", diff --git a/packages/core/src/codewhisperer/service/transformByQ/humanInTheLoopManager.ts b/packages/core/src/codewhisperer/service/transformByQ/humanInTheLoopManager.ts index ae1010c4358..c31a1fd6365 100644 --- a/packages/core/src/codewhisperer/service/transformByQ/humanInTheLoopManager.ts +++ b/packages/core/src/codewhisperer/service/transformByQ/humanInTheLoopManager.ts @@ -110,7 +110,6 @@ export class HumanInTheLoopManager { codeTransformJobId: transformByQState.getJobId(), result: MetadataResult.Fail, reason: errorMessage, - codeTransformApiErrorMessage: errorMessage, }) } diff --git a/packages/core/src/codewhisperer/service/transformByQ/transformApiHandler.ts b/packages/core/src/codewhisperer/service/transformByQ/transformApiHandler.ts index 252e2d7c38b..3cb05541e62 100644 --- a/packages/core/src/codewhisperer/service/transformByQ/transformApiHandler.ts +++ b/packages/core/src/codewhisperer/service/transformByQ/transformApiHandler.ts @@ -407,7 +407,6 @@ export async function zipCode({ dependenciesFolder, humanInTheLoopFlag, modulePa } catch (e: any) { telemetry.codeTransform_logGeneralError.emit({ codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId(), - codeTransformApiErrorMessage: 'Failed to zip project', result: MetadataResult.Fail, reason: 'ZipCreationFailed', }) diff --git a/packages/core/src/codewhisperer/tracker/codewhispererTracker.ts b/packages/core/src/codewhisperer/tracker/codewhispererTracker.ts index 59cc1d19dbe..e15c43e42ee 100644 --- a/packages/core/src/codewhisperer/tracker/codewhispererTracker.ts +++ b/packages/core/src/codewhisperer/tracker/codewhispererTracker.ts @@ -138,6 +138,8 @@ export class CodeWhispererTracker { codewhispererLanguage: suggestion.language, credentialStartUrl: AuthUtil.instance.startUrl, codewhispererUserGroup: CodeWhispererUserGroupSettings.getUserGroup().toString(), + codewhispererCharactersAccepted: suggestion.originalString.length, + codewhispererCharactersModified: 0, // TODO: currently we don't have an accurate number for this field with existing implementation }) // TODO: // Temperary comment out user modification event, need further discussion on how to calculate this metric