Skip to content

Commit 2181fa9

Browse files
authored
CM-59284: remove sentry and bump min CLI version (#137)
1 parent 41652fa commit 2181fa9

11 files changed

Lines changed: 18 additions & 1242 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## [Unreleased]
44

5+
- Remove Sentry integration
6+
- Increase required CLI version to 3.9.2
7+
58
## [v1.17.0]
69

710
- Increase required CLI version to 3.6.0

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@
463463
},
464464
"devDependencies": {
465465
"@eslint/js": "9.20.0",
466-
"@sentry/webpack-plugin": "3.1.2",
467466
"@stylistic/eslint-plugin": "3.1.0",
468467
"@types/decompress": "4.2.7",
469468
"@types/eslint__js": "8.42.3",
@@ -486,7 +485,6 @@
486485
"webpack-cli": "6.0.1"
487486
},
488487
"dependencies": {
489-
"@sentry/node": "8.49.0",
490488
"class-transformer": "0.5.1",
491489
"decompress": "4.2.1",
492490
"reflect-metadata": "0.2.2",

src/cli/cli-wrapper.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { CliError, isCliError } from './models/cli-error';
1212
import { ExitCode } from './exit-code';
1313
import { CommandParameters } from './constants';
1414
import { getUserAgentArg } from './user-agent';
15-
import { captureException } from '../sentry';
1615

1716
export class CliWrapper {
1817
public workDirectory?: string;
@@ -35,8 +34,7 @@ export class CliWrapper {
3534
let camelCasedObj;
3635
try {
3736
camelCasedObj = JSON_.parse(out);
38-
} catch (e) {
39-
captureException(e);
37+
} catch {
4038
this.logger.debug('Failed to parse output as JSON. Returning CliResultPanic');
4139
return new CliResultPanic(exitCode, out);
4240
}

src/constants.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export const getScanTypeDisplayName = (scanType: string): string => {
128128
return _SCAN_TYPE_TO_DISPLAY_NAME[scanType];
129129
};
130130

131-
export const REQUIRED_CLI_VERSION = '3.6.0';
131+
export const REQUIRED_CLI_VERSION = '3.9.2';
132132

133133
export const CLI_GITHUB = {
134134
OWNER: 'cycodehq',
@@ -159,9 +159,3 @@ export const getDefaultCliPath = (): string => {
159159
export const CYCODE_DOMAIN = 'cycode.com';
160160
export const DEFAULT_CYCODE_API_URL = `https://api.${CYCODE_DOMAIN}`;
161161
export const DEFAULT_CYCODE_APP_URL = `https://app.${CYCODE_DOMAIN}`;
162-
163-
export const SENTRY_DSN = 'https://d9527c2348300201235516c0c33a5824@o1026942.ingest.us.sentry.io/4507543875813376';
164-
export const SENTRY_DEBUG = false;
165-
export const SENTRY_SAMPLE_RATE = 1.0;
166-
export const SENTRY_SEND_DEFAULT_PII = false;
167-
export const SENTRY_INCLUDE_LOCAL_VARIABLES = false;

src/extension.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import * as vscode from 'vscode';
88
import { extensionName } from './utils/texts';
99
import statusBar from './utils/status-bar';
1010
import { config } from './utils/config';
11-
import { captureException, initSentry } from './sentry';
1211
import { container } from 'tsyringe';
1312
import { ICycodeService } from './services/cycode-service';
1413
import {
@@ -33,8 +32,6 @@ import { registerOnDidChangeActiveTextEditor } from './listeners/on-did-change-a
3332
import { showCliInstallFailed } from './utils/tray-notifications';
3433

3534
export function activate(context: vscode.ExtensionContext) {
36-
initSentry();
37-
3835
const logger = container.resolve<ILoggerService>(LoggerServiceSymbol);
3936
logger.initLogger();
4037
logger.info('Cycode extension is now active');
@@ -88,7 +85,6 @@ const postActivate = async () => {
8885
const cycode = container.resolve<ICycodeService>(CycodeServiceSymbol);
8986
await cycode.installCliIfNeededAndCheckAuthentication();
9087
} catch (error) {
91-
captureException(error);
9288
logger.error(`Cycode CLI is not installed: ${error}`);
9389
showCliInstallFailed();
9490
}

src/sentry.ts

Lines changed: 0 additions & 82 deletions
This file was deleted.

src/services/cli-service.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as vscode from 'vscode';
22
import * as fs from 'node:fs';
3-
import { setSentryUser } from '../sentry';
43
import { inject, singleton } from 'tsyringe';
54
import { ExtensionServiceSymbol, LoggerServiceSymbol, ScanResultsServiceSymbol, StateServiceSymbol } from '../symbols';
65
import { GlobalExtensionState, IStateService, TemporaryExtensionState } from './state-service';
@@ -156,9 +155,6 @@ export class CliService implements ICliService {
156155
this.showErrorNotification('You are not authenticated in Cycode. Please authenticate');
157156
} else {
158157
statusBar.showDefault();
159-
if (processedResult.result.userId && processedResult.result.tenantId) {
160-
setSentryUser(processedResult.result.userId, processedResult.result.tenantId);
161-
}
162158
}
163159

164160
return;

src/services/cycode-service.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { ProgressOptions } from 'vscode';
1212
import { ILoggerService } from './logger-service';
1313
import { getScanTypeDisplayName } from '../constants';
1414
import statusBar from '../utils/status-bar';
15-
import { captureException } from '../sentry';
1615
import { CliIgnoreType } from '../cli/models/cli-ignore-type';
1716
import { IScanResultsService } from './scan-results-service';
1817
import { IExtensionService } from './extension-service';
@@ -52,7 +51,6 @@ export class CycodeService implements ICycodeService {
5251
progress.report({ message });
5352
return await fn(cancellationToken);
5453
} catch (error: unknown) {
55-
captureException(error);
5654
if (error instanceof Error) {
5755
this.logger.error(`Error during progress: ${error.message}. FN: ${fn}`);
5856
vscode.window.showErrorMessage(`Cycode error: ${error.message}`);

src/utils/file-checksum.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as fs from 'fs';
22
import * as crypto from 'crypto';
33
import * as path from 'path';
4-
import { captureException } from '../sentry';
54
import { container } from 'tsyringe';
65
import { ILoggerService } from '../services/logger-service';
76
import { LoggerServiceSymbol } from '../symbols';
@@ -24,7 +23,6 @@ export const verifyFileChecksum = (filePath: string, checksum: string): boolean
2423
try {
2524
return getFileShaHash(filePath).toLowerCase() === checksum.toLowerCase();
2625
} catch (error) {
27-
captureException(error);
2826
logger.error(`Failed to verify file checksum ${error}`);
2927
}
3028

webpack.config.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"use strict";
44

55
const path = require("path");
6-
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");
76

87
//@ts-check
98
/** @typedef {import('webpack').Configuration} WebpackConfig **/
@@ -42,14 +41,6 @@ const extensionConfig = {
4241
],
4342
},
4443
devtool: "source-map",
45-
plugins: [
46-
sentryWebpackPlugin({
47-
org: "cycode",
48-
project: "vscode-extension",
49-
telemetry: false,
50-
authToken: process.env.SENTRY_AUTH_TOKEN,
51-
}),
52-
],
5344
infrastructureLogging: {
5445
level: "log", // enables logging required for problem matchers
5546
},

0 commit comments

Comments
 (0)