Skip to content

Commit

Permalink
fix(test): forcing cli build to test isolating sentry, adding debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-cahill committed Oct 18, 2023
1 parent 3157933 commit 663a235
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/base-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import AppService from './app-config/service';
import { prettyValidationErrors } from './common/dependency-manager/validation';
import LoginRequiredError from './common/errors/login-required';
import { isBooleanStringFlag } from './common/utils/oclif';
// import SentryService from './sentry';
import SentryService from './sentry';

export default abstract class BaseCommand extends Command {
app: AppService;
// sentry: SentryService;
sentry: SentryService;

async auth_required(): Promise<boolean> {
return true;
Expand All @@ -20,7 +20,7 @@ export default abstract class BaseCommand extends Command {
constructor(argv: string[], config: Config) {
super(argv, config);
this.app = AppService.create(this.config.configDir, this.config.userAgent.split(/\/|\s/g)[2]);
// this.sentry = new SentryService(this);
this.sentry = new SentryService(this);
}

// override debug being a protected method on the oclif Command class
Expand Down Expand Up @@ -110,7 +110,7 @@ export default abstract class BaseCommand extends Command {

async finally(err?: Error): Promise<any> {
try {
// await this.sentry.endSentryTransaction(err);
await this.sentry.endSentryTransaction(err);

this.app.posthog.capture({
event: 'cli.command.complete',
Expand Down
2 changes: 1 addition & 1 deletion src/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class SentryService {
Sentry.init({
enabled: process.env.TEST !== '1' && process.env.NODE_ENV !== 'development' && process.env.NODE_ENV !== ENVIRONMENT.PREVIEW,
dsn: CLI_SENTRY_DSN,
debug: false,
debug: true, // TODO: restore: false
environment: process.env?.NODE_ENV ?? 'production',
release: process.env?.npm_package_version,
tracesSampleRate: 1.0,
Expand Down

0 comments on commit 663a235

Please sign in to comment.