Skip to content

Commit feaa1b9

Browse files
committed
telemetry(lambda): change toolId to 'localstack' on installation through walkthrough
But add ts-ignore until this value gets added to metric definitions [1] [1]: https://github.com/aws/aws-toolkit-common/blob/8c88537fae2ac7e6524fb2b29ae336c606850eeb/telemetry/definitions/commonDefinitions.json#L2215-L2221
1 parent 54f5554 commit feaa1b9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/core/src/awsService/appBuilder/walkthrough.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,9 @@ export async function getOrInstallCliWrapper(toolId: AwsClis, source: string) {
350350

351351
export async function installLocalStackExtension(source: string) {
352352
await telemetry.appBuilder_installTool.run(async (span) => {
353-
// TODO: update `toolId` to "localstack" after updating the telemetry definitions: https://github.com/aws/aws-toolkit-common/blob/8c88537fae2ac7e6524fb2b29ae336c606850eeb/telemetry/definitions/commonDefinitions.json#L2215-L2221
354-
const toolId: ToolId = 'sam-cli'
353+
// TODO: Update `ToolId` accepted values: https://github.com/aws/aws-toolkit-common/blob/8c88537fae2ac7e6524fb2b29ae336c606850eeb/telemetry/definitions/commonDefinitions.json#L2215-L2221
354+
// @ts-ignore
355+
const toolId: ToolId = 'localstack'
355356
span.record({ source, toolId })
356357
const extensionId = 'localstack.localstack'
357358
const extension = vscode.extensions.getExtension(extensionId)

packages/core/src/test/awsService/appBuilder/walkthrough.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { ChildProcess } from '../../../shared/utilities/processUtils'
2626
import { assertTelemetryCurried } from '../../testUtil'
2727
import { HttpResourceFetcher } from '../../../shared/resourcefetcher/node/httpResourceFetcher'
2828
import { SamCliInfoInvocation } from '../../../shared/sam/cli/samCliInfo'
29+
import type { ToolId } from '../../../shared/telemetry/telemetry'
2930
import { CodeScansState } from '../../../codewhisperer'
3031

3132
interface TestScenario {
@@ -463,7 +464,8 @@ describe('AppBuilder Walkthrough', function () {
463464
})
464465

465466
describe('Install LocalStack Extension', function () {
466-
const expectedLocalStackToolId = 'sam-cli' // temporarily until toolkit-common changes
467+
// @ts-ignore until TODO from src/awsService/appBuilder/walkthrough.ts:installLocalStackExtension
468+
const expectedLocalStackToolId: ToolId = 'localstack'
467469

468470
it('should show already installed message when extension exists', async function () {
469471
const mockExtension = { id: 'localstack.localstack' }
@@ -485,7 +487,7 @@ describe('AppBuilder Walkthrough', function () {
485487
assertTelemetry({
486488
result: 'Succeeded',
487489
source: 'test-source',
488-
toolId: expectedLocalStackToolId, // Note: currently uses sam-cli as toolId per TODO comment
490+
toolId: expectedLocalStackToolId,
489491
})
490492
})
491493

0 commit comments

Comments
 (0)