Skip to content

Commit 944d5d0

Browse files
committed
Remove timestamp parameter
1 parent 23d39aa commit 944d5d0

File tree

3 files changed

+1
-37
lines changed

3 files changed

+1
-37
lines changed

src/main/wrapper/CxConstants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ export enum CxConstants {
115115
TELEMETRY = "telemetry",
116116
SUB_CMD_TELEMETRY_AI = "ai",
117117
AI_PROVIDER = "--ai-provider",
118-
TIMESTAMP = "--timestamp",
119118
TYPE = "--type",
120119
SUB_TYPE = "--sub-type",
121120
PROBLEM_SEVERITY = "--problem-severity"

src/main/wrapper/CxWrapper.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,13 +448,12 @@ export class CxWrapper {
448448
return new ExecutionService().executeCommands(this.config.pathToExecutable, commands, CxConstants.MASK_TYPE);
449449
}
450450

451-
telemetryAIEvent(aiProvider: string, agent: string, timestamp: Date, eventType: string, subType: string, engine: string, problemSeverity: string): Promise<CxCommandOutput> {
451+
telemetryAIEvent(aiProvider: string, agent: string, eventType: string, subType: string, engine: string, problemSeverity: string): Promise<CxCommandOutput> {
452452
const commands: string[] = [
453453
CxConstants.TELEMETRY,
454454
CxConstants.SUB_CMD_TELEMETRY_AI,
455455
CxConstants.AI_PROVIDER, aiProvider,
456456
CxConstants.AGENT, agent,
457-
CxConstants.TIMESTAMP, timestamp?.toISOString(),
458457
CxConstants.TYPE, eventType,
459458
CxConstants.SUB_TYPE, subType,
460459
CxConstants.ENGINE, engine,

src/tests/TelemetryTest.test.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ describe("Telemetry cases", () => {
77

88
it.skip('TelemetryAIEvent Successful case with minimal parameters', async () => {
99
const wrapper = new CxWrapper(cxScanConfig);
10-
const timestamp = new Date();
1110
const cxCommandOutput: CxCommandOutput = await wrapper.telemetryAIEvent(
1211
"Cursor",
1312
"Cursos",
14-
timestamp,
1513
"click",
1614
"ast-results.viewPackageDetails",
1715
"secrets",
@@ -21,29 +19,12 @@ describe("Telemetry cases", () => {
2119
expect(cxCommandOutput.exitCode).toBe(0);
2220
});
2321

24-
it.skip('TelemetryAIEvent Successful case with past timestamp', async () => {
25-
const wrapper = new CxWrapper(cxScanConfig);
26-
const pastTimestamp = new Date(Date.now() - 3600000); // 1 hour ago
27-
const cxCommandOutput: CxCommandOutput = await wrapper.telemetryAIEvent(
28-
"openai",
29-
"vscode",
30-
pastTimestamp,
31-
"click",
32-
"ast-results.viewPackageDetails",
33-
"oss",
34-
"high"
35-
);
36-
console.log("Json object from telemetryAIEvent with past timestamp: " + JSON.stringify(cxCommandOutput));
37-
expect(cxCommandOutput.exitCode).toBe(0);
38-
});
3922

4023
it.skip('TelemetryAIEvent Successful case with edge case parameters', async () => {
4124
const wrapper = new CxWrapper(cxScanConfig);
42-
const timestamp = new Date();
4325
const cxCommandOutput: CxCommandOutput = await wrapper.telemetryAIEvent(
4426
"",
4527
"",
46-
timestamp,
4728
"",
4829
"",
4930
"",
@@ -52,19 +33,4 @@ describe("Telemetry cases", () => {
5233
console.log("Json object from telemetryAIEvent with empty parameters: " + JSON.stringify(cxCommandOutput));
5334
expect(typeof cxCommandOutput.exitCode).toBe(0);
5435
});
55-
56-
it.skip('TelemetryAIEvent Successful case without timestamp', async () => {
57-
const wrapper = new CxWrapper(cxScanConfig);
58-
const cxCommandOutput: CxCommandOutput = await wrapper.telemetryAIEvent(
59-
"Copilot",
60-
"VS Code",
61-
undefined,
62-
"click",
63-
"ast-results.viewPackageDetails",
64-
"oss",
65-
"medium"
66-
);
67-
console.log("Json object from telemetryAIEvent without timestamp: " + JSON.stringify(cxCommandOutput));
68-
expect(typeof cxCommandOutput.exitCode).toBe(0);
69-
});
7036
});

0 commit comments

Comments
 (0)