Skip to content

ci(danger): Demote Android SDK version mismatch from fail to warn#6018

Merged
antonis merged 1 commit intomainfrom
chore/demote-android-sdk-mismatch-to-warning
Apr 17, 2026
Merged

ci(danger): Demote Android SDK version mismatch from fail to warn#6018
antonis merged 1 commit intomainfrom
chore/demote-android-sdk-mismatch-to-warning

Conversation

@antonis
Copy link
Copy Markdown
Contributor

@antonis antonis commented Apr 17, 2026

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Downgrade the Danger check in scripts/check-android-sdk-mismatch.js from fail() to warn() when the sentry-android version in packages/core/android/build.gradle differs from the version bundled by the pinned Sentry Android Gradle Plugin (AGP).

The message is also updated to reflect that the crash is conditional on AGP autoInstallation being enabled, and to point reviewers at the docs-based mitigation rather than treating the mismatch as a guaranteed crash.

💡 Motivation and Context

The check was originally added as a hard fail because an IllegalStateException: Sentry SDK has detected a mix of versions crash can occur at app startup when AGP's autoInstallation (default: true) pulls in a different sentry-android version than the one shipped by @sentry/react-native.

Since then, the docs have been updated to explicitly instruct React Native users to disable autoInstallation in their android/app/build.gradle:

Per internal discussion, adding AGP to a React Native app is an explicit opt-in step, and users performing that step are expected to follow the setup guide — which now prominently instructs them to set autoInstallation.enabled = false. In that world, a version mismatch between our bundled sentry-android and the version AGP would auto-install is no longer a guaranteed crash: it only affects users who both opt into AGP and ignore the documented configuration.

Keeping the check as fail() couples RN SDK release cadence to gradle plugin release cadence (we couldn't bump sentry-android until a matching AGP release shipped), without providing meaningful additional protection over the docs. Demoting to warn() preserves reviewer visibility while unblocking dependency bumps.

💚 How did you test it?

  • Manual review of the updated Danger rule; all other branches in the script already emit warn() with a ⚠️ icon, so the mismatch branch is now visually and behaviorally consistent with them.
  • The check path is otherwise unchanged — same parsing, same upstream fetch, same comparison; only the severity and message content change.

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

The check was introduced to prevent shipping a sentry-android version that
differs from the one bundled by our pinned Sentry Android Gradle Plugin,
since a mismatch causes an IllegalStateException crash when AGP
autoInstallation is enabled.

Following the documentation update in
getsentry/sentry-docs#17349, React Native users are now explicitly told
to set autoInstallation.enabled = false. Per internal discussion, users
who opt into AGP are expected to follow the setup guide, so the footgun
is no longer silent, and hard-failing the check unnecessarily couples RN
SDK release cadence to gradle plugin release cadence.

Downgrade to warn() so reviewers still see the mismatch, with an updated
message pointing to the docs-based mitigation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 17, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • ci(danger): Demote Android SDK version mismatch from fail to warn by antonis in #6018
  • chore(deps): update JavaScript SDK to v10.49.0 by github-actions in #6011
  • ci: Integrate Warden for AI-powered PR code review by antonis in #6003
  • chore(lint): Fixes lint issue on main by antonis in #6013
  • feat(expo): Warn when prebuilt native projects are missing Sentry config by alwx in #5984

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request

Generated by 🚫 dangerJS against 6fb08f7

@antonis antonis marked this pull request as ready for review April 17, 2026 11:43
@antonis antonis merged commit 52d789a into main Apr 17, 2026
61 of 66 checks passed
@antonis antonis deleted the chore/demote-android-sdk-mismatch-to-warning branch April 17, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants