Skip to content

Commit

Permalink
feat: skip CI prompt if --coming-from vercel (#848)
Browse files Browse the repository at this point in the history
  • Loading branch information
obostjancic authored Mar 11, 2025
1 parent 5ae7ccc commit c91498e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Unreleased

- feat: Add `coming-from` parameter ([#837](https://github.com/getsentry/sentry-wizard/pull/837))
- feat: Skip CI prompt if `--coming-from` `vercel` ([#848](https://github.com/getsentry/sentry-wizard/pull/848))
- feat(deps): Bump axios from 1.7.4 to 1.8.2 ([#844](https://github.com/getsentry/sentry-wizard/pull/844))
- feat(sourcemaps): Remove NextJS and Remix flows from sourcemaps wizard ([#849](https://github.com/getsentry/sentry-wizard/pull/849))

Expand All @@ -13,6 +13,8 @@

## 4.2.0

- feat: Add `coming-from` parameter ([#837](https://github.com/getsentry/sentry-wizard/pull/837))

### Various fixes & improvements

- feat: add coming-from parameter (#837) by @obostjancic
Expand Down
9 changes: 5 additions & 4 deletions src/nextjs/nextjs-wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import {
import { traceStep, withTelemetry } from '../telemetry';
import { getPackageVersion, hasPackageInstalled } from '../utils/package-json';
import { getNextJsVersionBucket } from './utils';
import { configureCI } from '../sourcemaps/sourcemaps-wizard';
import { setupCI } from '../sourcemaps/sourcemaps-wizard';

export function runNextjsWizard(options: WizardOptions) {
return withTelemetry(
Expand Down Expand Up @@ -329,12 +329,13 @@ export async function runNextjsWizardWithTelemetry(
path.join(process.cwd(), 'vercel.json'),
);

if (mightBeUsingVercel) {
if (mightBeUsingVercel && !options.comingFrom) {
clack.log.info(
"▲ It seems like you're using Vercel. We recommend using the Sentry Vercel integration to set up an auth token for Vercel deployments: https://vercel.com/integrations/sentry",
"▲ It seems like you're using Vercel. We recommend using the Sentry Vercel \
integration to set up an auth token for Vercel deployments: https://vercel.com/integrations/sentry",
);
} else {
await traceStep('configure-ci', () => configureCI('nextjs', authToken));
await setupCI('nextjs', authToken, options.comingFrom);
}

const packageManagerForOutro =
Expand Down
18 changes: 17 additions & 1 deletion src/sourcemaps/sourcemaps-wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ You can turn this off by running the wizard with the '--disable-telemetry' flag.
}),
);

await traceStep('ci-setup', () => configureCI(selectedTool, authToken));
await traceStep('ci-setup', () =>
setupCI(selectedTool, authToken, options.comingFrom),
);

traceStep('outro', () =>
printOutro(
Expand Down Expand Up @@ -202,6 +204,20 @@ async function startToolSetupFlow(
break;
}
}
export async function setupCI(
selectedTool: SupportedTools,
authToken: string,
comingFrom: WizardOptions['comingFrom'],
) {
if (comingFrom === 'vercel') {
clack.log.info(
'Sentry Vercel integration is already configured. Skipping CI setup.',
);
Sentry.setTag('using-ci', true);
} else {
await traceStep('configure-ci', () => configureCI(selectedTool, authToken));
}
}

export async function configureCI(
selectedTool: SupportedTools,
Expand Down

0 comments on commit c91498e

Please sign in to comment.