Repository navigation
fix(cli): Create .gitignore for the wizard's auth token file - #2796
Merged
Merged
Conversation
When a project had no .gitignore, the wizard logged "Please add it manually!" and continued, so .env.sentry-build-plugin with the auth token could be committed. Create .gitignore with the entry instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
msonnb
marked this pull request as ready for review
December 2, 2026 13:57
github-actions Bot
pushed a commit
to Fields-Education/sentry-mcp
that referenced
this pull request
Dec 4, 2026
…entry#2839) From the mobile re-test (getsentry/sentry-react-native#7172). Even with every feature flag (`--tracing --profiling --logs --replay --feedback --no-mcp < /dev/null`), `sentry wizard reactNative` exited 1 at a prompt: bare React Native at "Do you want to run `pod install` now?", Expo at "Have you successfully sent a test event?". This lets the React Native and Expo wizards finish without a terminal, which the wizard e2e tests in getsentry#2572 need. **`pod install`**: new `--pod-install`/`--no-pod-install` flag in `WIZARD_ANSWER_FLAGS` (reactNative only). `confirmPodInstall` asks through `askFlagQuestion` and keeps Yes as the default. **Closing question**: it only confirms a setup that is already done, so it is skipped when stdin is not a TTY (`isatty(0)`, as `guardNonInteractive` and auto-login check). Piped stdin that is still open counts as no terminal too. The run then ends with an outro that says Sentry is set up, tells the user to send a test event and check it in Sentry, and links the project's issues page and the sentry-react-native GitHub issues. `user-confirmed-first-error` is `"skipped"`. With a terminal, it is asked as before. **Expo second run**: a `metro.config.js` that already has Sentry is its own `"already-configured"` outcome of `patchMetroInMemory`. It is logged once, with no "Could not patch" error and no copy-paste instructions. Those instructions also asked "Did you apply the snippet above?", which would have stopped a run without a terminal too. Parse and write failures still show them, as getsentry#2786 does for `app.json`. **`.gitignore` duplicates**: Expo's `.env.local` (`addToGitignore`) and Flutter's `sentry.properties` (`addProperties`) are appended only when no line already is the entry, ignoring surrounding whitespace. The check is `gitignoreHasEntry` in `utils/git.ts`. `addCliConfigFileToGitIgnore` now uses it as well, so whitespace around the entry counts there too. getsentry#2796 also changes `addCliConfigFileToGitIgnore`, but in other lines. <!-- junior-request-attribution:start --> via **Antonis Lilis**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AD0CAPGCFLSC%3A1796305761.291369 --> -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AD0CAPGCFLSC%3A1796305761.291369) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0CAPGCFLSC%3A1796305761.291369/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Antonis Lilis <antonis.lilis@sentry.io>
BYK
approved these changes
Dec 4, 2026
14 of 16 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The JS wizards (Next.js, SvelteKit, Nuxt, React Router, and the source maps wizard) write the org auth token to
.env.sentry-build-plugin. Then they add that file to.gitignore. If the project had no.gitignore, the wizard logged "Please add it manually!" and carried on, so the token file could be committed.addCliConfigFileToGitIgnorenow creates.gitignorewith the entry when the file does not exist. It writes with thewxflag, so it never overwrites a.gitignorethat appears in the meantime. An existing.gitignoreis handled as before.The new test runs
addDotEnvSentryBuildPluginFilein a real temp directory with no.gitignore, with one that lacks the entry, and with one that already has it. The no-file case fails without the fix.