Repository navigation
fix(cli): Warn that the Android wizard's auth token stays on this machine - #2806
Conversation
…hine `sentry wizard android` writes the auth token to the gitignored `sentry.properties`, and with source context on, every Release build runs the Sentry Gradle plugin's upload tasks. On machines without the file, those tasks fail the build. After writing the file, warn about that and say how to provide a token (`SENTRY_AUTH_TOKEN` in CI, or a `sentry.properties` per machine). With the placeholder token, say that this machine's Release build fails too and link the token settings page. The outro gets one line about it, and the `auth-token-placeholder` tag records which case ran. `buildAuthTokenSettingsUrl` moves out of `createAuthToken` so both use it. Co-Authored-By: Antonis Lilis <antonis.lilis@sentry.io>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
antonis
left a comment
There was a problem hiding this comment.
On self-hosted Sentry, the wizard also writes the server URL to sentry.properties (url: selfHosted ? sentryUrl : undefined), so machines without the file are missing the URL too. When the project is self-hosted, also tell the user to set SENTRY_URL along with SENTRY_AUTH_TOKEN in CI, in both the warning and the outro line. Add a test.
On self-hosted Sentry, sentry.properties also holds the server URL, so machines without the file need SENTRY_URL along with SENTRY_AUTH_TOKEN. Say so in the warning and the outro line.
|
@antonis Fixed in d6d847a67. On self-hosted projects, the warning now says |
…th-token-warning # Conflicts: # packages/cli/test/lib/wizard/android/android-wizard.test.ts
addSentryCliConfig keeps an auth token that sentry.properties already has, so this run's token may not be the one in the file. Check the file for the placeholder instead, and fall back to this run's token only when the file can't be read.
…th-token-warning Resolve the android-wizard.ts conflict with #2805: keep both PRs' constants (GRADLE_PLUGIN_DOCS and the CI env vars) and both PRs' helpers (the token warning helpers and warnGradleCheckFailed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comes from testing
sentry wizard androidon fresh Android Studio projects (getsentry/sentry-java#6797). The wizard writes the auth token tosentry.properties, adds that file to.gitignore, and turns onincludeSourceContext, so every Release build runssentryUploadSourceBundleRelease. On a teammate's clone, or in CI withoutSENTRY_AUTH_TOKEN, that task has no token and fails the build, while the wizard ends with "Successfully installed the Sentry Android SDK!".@sentry/wizardbehaves the same.The lasting fix belongs in the Sentry Android Gradle Plugin, which should skip the upload with a warning when there's no token. Until then, the wizard tells the user; what the build does is unchanged:
sentry.properties, a warning says the file holds the auth token and is gitignored, so Release builds on other machines fail at the Sentry upload until they have a token. It says to setSENTRY_AUTH_TOKENin CI (with the org's auth token settings URL) or to have teammates create their ownsentry.properties.SENTRY_URLin CI.DUMMY_AUTH_TOKENplaceholder, the warning says this machine's Release build fails too and shows the settings URL to replace it.auth-token-placeholder.buildAuthTokenSettingsUrlis extracted fromcreateAuthTokeninutils/project-data.tsso both warnings build the URL the same way. Thesentry wizarddocs fragment gets a short Android note.Open decision: this stays a draft until the author decides it's ready.
via Antonis Lilis.
--
View Session [Sentry]