Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: skip CI prompt if --coming-from vercel #848

Merged
merged 7 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading