Conversation
… is enabled When `flavorAware` is set and the per-variant properties file is missing, or required keys (`auth.token`/`SENTRY_AUTH_TOKEN`, `defaults.org`, `defaults.project`) are absent, sentry.gradle previously swallowed the error and passed `null` values to sentry-cli, failing with an opaque `Illegal null value provided in this collection`. Validate the file and required keys up front and throw a `GradleException` naming the expected path and any missing keys. Also only append `--url` when `defaults.url` is set, so sentry-cli can fall back to its default. Fixes #2839 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Matches convention used by other entries under Unreleased. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
@sentry review |
Contributor
Author
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8458b0a. Configure here.
alwx
approved these changes
Apr 22, 2026
This was referenced Apr 23, 2026
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.
📢 Type of change
📜 Description
When
flavorAwareis set inproject.ext.sentryCliand the per-variant properties file is missing, or required keys are absent,sentry.gradlepreviously swallowed theFileNotFoundException(logging atinfo) and passednullvalues to sentry-cli. Gradle then failed with an opaque:This PR makes the error actionable:
GradleExceptionnaming the expectedsentry-${variant}.propertiespath when the file is missing (flavor-aware only).auth.token/SENTRY_AUTH_TOKEN,defaults.org,defaults.project) and throws a single error listing them all alongside the file path.--urlwhendefaults.urlis set, so sentry-cli falls back to its default instead of being handednull.SENTRY_PROPERTIESenv flow) is unchanged.💡 Motivation and Context
Users hitting this flow today (see #2837 as an example of the cryptic surface error) have no indication of which file was expected or which key was missing. This change surfaces both directly.
Fixes #2839.
💚 How did you test it?
Parse check —
./gradlew :app:helponsamples/react-native/androidwith the updatedsentry.gradlesymlinked via the yarn workspace: builds the task graph without errors.Validation harness — built a standalone Gradle project that copies the exact validation block (same message strings, same control flow) and drives 8 scenarios. All pass:
flavorAware=true, properties file missingGradleExceptionnaming the expected path andflavorAwareflavorAware=true, file present, onlydefaults.orgmissingGradleExceptionreporting only that key, with file pathflavorAware=true, file fully populated--url,--auth-token,--org,--projectwith no nullsflavorAware=true,auth.tokenabsent butSENTRY_AUTH_TOKENset--auth-tokenuses env valueflavorAware=true, all three required keys missingGradleExceptionlisting all three keysflavorAware=true,defaults.urlempty string--urlflag omitted; required args still presentflavorAware=false, properties file missingflavorAware=false, file presentNot run locally: a full
:app:bundleReleaseagainst real Sentry infrastructure. The change is isolated to thedoLastblock inside the_SentryUpload_task, and the scenarios above cover every branch touched. No Gradle/Groovy test harness exists in this repo to check these in automatically.📝 Checklist
sendDefaultPIIis enabled🔮 Next steps
🤖 Generated with Claude Code