Skip to content

Commit c91498e

Browse files
authored
feat: skip CI prompt if --coming-from vercel (#848)
1 parent 5ae7ccc commit c91498e

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Unreleased
44

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

@@ -13,6 +13,8 @@
1313

1414
## 4.2.0
1515

16+
- feat: Add `coming-from` parameter ([#837](https://github.com/getsentry/sentry-wizard/pull/837))
17+
1618
### Various fixes & improvements
1719

1820
- feat: add coming-from parameter (#837) by @obostjancic

src/nextjs/nextjs-wizard.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import {
4949
import { traceStep, withTelemetry } from '../telemetry';
5050
import { getPackageVersion, hasPackageInstalled } from '../utils/package-json';
5151
import { getNextJsVersionBucket } from './utils';
52-
import { configureCI } from '../sourcemaps/sourcemaps-wizard';
52+
import { setupCI } from '../sourcemaps/sourcemaps-wizard';
5353

5454
export function runNextjsWizard(options: WizardOptions) {
5555
return withTelemetry(
@@ -329,12 +329,13 @@ export async function runNextjsWizardWithTelemetry(
329329
path.join(process.cwd(), 'vercel.json'),
330330
);
331331

332-
if (mightBeUsingVercel) {
332+
if (mightBeUsingVercel && !options.comingFrom) {
333333
clack.log.info(
334-
"▲ 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",
334+
"▲ It seems like you're using Vercel. We recommend using the Sentry Vercel \
335+
integration to set up an auth token for Vercel deployments: https://vercel.com/integrations/sentry",
335336
);
336337
} else {
337-
await traceStep('configure-ci', () => configureCI('nextjs', authToken));
338+
await setupCI('nextjs', authToken, options.comingFrom);
338339
}
339340

340341
const packageManagerForOutro =

src/sourcemaps/sourcemaps-wizard.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ You can turn this off by running the wizard with the '--disable-telemetry' flag.
9999
}),
100100
);
101101

102-
await traceStep('ci-setup', () => configureCI(selectedTool, authToken));
102+
await traceStep('ci-setup', () =>
103+
setupCI(selectedTool, authToken, options.comingFrom),
104+
);
103105

104106
traceStep('outro', () =>
105107
printOutro(
@@ -202,6 +204,20 @@ async function startToolSetupFlow(
202204
break;
203205
}
204206
}
207+
export async function setupCI(
208+
selectedTool: SupportedTools,
209+
authToken: string,
210+
comingFrom: WizardOptions['comingFrom'],
211+
) {
212+
if (comingFrom === 'vercel') {
213+
clack.log.info(
214+
'Sentry Vercel integration is already configured. Skipping CI setup.',
215+
);
216+
Sentry.setTag('using-ci', true);
217+
} else {
218+
await traceStep('configure-ci', () => configureCI(selectedTool, authToken));
219+
}
220+
}
205221

206222
export async function configureCI(
207223
selectedTool: SupportedTools,

0 commit comments

Comments
 (0)