Skip to content

Commit c816ff5

Browse files
Add Telemetry to Ignore Buttons (AST-107521) (#1228)
* Add Containers Realtime Scanner * log user events for ignore commands * fix: correct command casing for ignore all action
1 parent a0bab36 commit c816ff5

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

src/commands/openAIChatCommand.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ export class CopilotChatCommand {
195195

196196
this.context.subscriptions.push(
197197
vscode.commands.registerCommand(commands.ignorePackage, async (item: HoverData | SecretsHoverData) => {
198+
this.logUserEvent("click", constants.ignorePackage, item);
199+
198200
try {
199201
const workspaceFolder = getWorkspaceFolder(item.filePath);
200202
if (!workspaceFolder) {
@@ -255,7 +257,8 @@ export class CopilotChatCommand {
255257

256258

257259
this.context.subscriptions.push(
258-
vscode.commands.registerCommand(commands.IgnoreAll, async (item: HoverData) => {
260+
vscode.commands.registerCommand(commands.ignoreAll, async (item: HoverData) => {
261+
this.logUserEvent("click", constants.ignoreAll, item);
259262
try {
260263
const workspaceFolder = getWorkspaceFolder(item.filePath);
261264
const ignoreManager = getInitializedIgnoreManager(workspaceFolder);

src/realtimeScanners/scanners/CxCodeActionProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class CxCodeActionProvider implements vscode.CodeActionProvider {
6464
const ignoreAllVulnerbility = "Ignore all of this type";
6565
const ignoreAllAction = new vscode.CodeAction(ignoreAllVulnerbility, vscode.CodeActionKind.QuickFix);
6666
ignoreAllAction.command = {
67-
command: commands.IgnoreAll,
67+
command: commands.ignoreAll,
6868
title: ignoreAllAction.title,
6969
arguments: [item]
7070
};

src/utils/common/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ export const commands = {
121121
openSettingsArgs: `@ext:checkmarx.${constants.extensionName}`,
122122
openAIChat: `${constants.extensionName}.${constants.openAIChat}`,
123123
viewDetails: `${constants.extensionName}.${constants.viewDetails}`,
124-
ignorePackage: `${constants.extensionName}.ignorePackage`,
125-
IgnoreAll: `${constants.extensionName}.ignoreAll`,
124+
ignorePackage: `${constants.extensionName}.${constants.ignorePackage}`,
125+
ignoreAll: `${constants.extensionName}.${constants.ignoreAll}`,
126126
openIgnoredView: `${constants.extensionName}.openIgnoredView`,
127127

128128
};

src/utils/common/constants.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,9 @@ export const constants = {
247247
copilotChatOpenWithQueryCommand: "workbench.action.chat.openAgent",
248248

249249
openAIChat: "fixWithAIChat",
250-
viewDetails: "viewPackageDetails"
250+
viewDetails: "viewPackageDetails",
251+
ignoreAll: "ignoreAll",
252+
ignorePackage: "ignorePackage"
251253
};
252254

253255
export enum Platform {

src/utils/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ export function buildCommandButtons(args: string, hasIgnoreAll: boolean): string
282282
return `<a href="command:${commands.openAIChat}?${args}">Fix with CxOne Assist</a> &emsp;
283283
<a href="command:${commands.viewDetails}?${args}">View details</a> &emsp;
284284
<a href="command:${commands.ignorePackage}?${args}">Ignore this vulnerability</a> &emsp;
285-
<a href="command:${commands.IgnoreAll}?${args}">${hasIgnoreAll ? "Ignore all of this type" : " "}</a>&emsp;
285+
<a href="command:${commands.ignoreAll}?${args}">${hasIgnoreAll ? "Ignore all of this type" : " "}</a>&emsp;
286286
`;
287287
}
288288

0 commit comments

Comments
 (0)