diff --git a/CHANGELOG.md b/CHANGELOG.md index 63f414ab..97a7cac1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) @@ -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 diff --git a/src/nextjs/nextjs-wizard.ts b/src/nextjs/nextjs-wizard.ts index bdd427a8..abc5ee69 100644 --- a/src/nextjs/nextjs-wizard.ts +++ b/src/nextjs/nextjs-wizard.ts @@ -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( @@ -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 = diff --git a/src/sourcemaps/sourcemaps-wizard.ts b/src/sourcemaps/sourcemaps-wizard.ts index 25b49aff..3d39f89b 100644 --- a/src/sourcemaps/sourcemaps-wizard.ts +++ b/src/sourcemaps/sourcemaps-wizard.ts @@ -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( @@ -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,