From 79ac9506ff347d8da06e17922ee35cb981fdd4b1 Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Mon, 30 Nov 2026 15:11:55 +0100 Subject: [PATCH] docs: Remove obsolete migration guide Remove the unmaintained sentry-java to sentry-android migration guide, which documents APIs and setup from older SDK generations. Keep compatibility callouts in the changelog and remove the stale review reference. Co-Authored-By: Claude --- MIGRATION.md | 155 --------------------------------------------------- REVIEWS.md | 2 +- 2 files changed, 1 insertion(+), 156 deletions(-) delete mode 100644 MIGRATION.md diff --git a/MIGRATION.md b/MIGRATION.md deleted file mode 100644 index 5513d143ddb..00000000000 --- a/MIGRATION.md +++ /dev/null @@ -1,155 +0,0 @@ -# Migrating from `sentry-java` to `sentry-android` - -#### Docs - -Migration page from [sentry-android 1.x to sentry-android 2.x](https://docs.sentry.io/platforms/android/migrate). - -#### Installation - -_Old_: - -``` -Sentry.init("___PUBLIC_DSN___", new AndroidSentryClientFactory(context)); -``` - -_New_: - -The SDK is able to initialize automatically. The only thing required is to make the DSN available. -*`sentry.properties` has been discontinued and configurations on this SDK version is over `AndroidManifest.xml` or code.* - -```xml - -``` -_Or:_ - -*If you want to call `SentryAndroid.init(...)` by yourself, first of all you need to disable the `auto-init` feature.* - -```xml - -``` - -``` -SentryAndroid.init(context, options -> { - options.setDsn("___PUBLIC_DSN___"); -}); -``` - -#### Set tag - -_Old_: - -``` -Sentry.getContext().addTag("tagName", "tagValue"); -``` - -_New_: - -``` -Sentry.setTag("tagName", "tagValue"); -``` - -#### Capture custom exception - -_Old_: - -``` -try { - int x = 1 / 0; -} catch (Exception e) { - Sentry.capture(e); -} -``` - -_New_: - -``` -try { - int x = 1 / 0; -} catch (Exception e) { - Sentry.captureException(e); -} -``` - -#### Capture a custom event - -_Old_: - -``` -Exception exception = new Exception("custom error"); -EventBuilder eventBuilder = new EventBuilder() - .withLevel(Event.Level.ERROR) - .withSentryInterface(new ExceptionInterface(exception)); -Sentry.capture(eventBuilder); -``` - -_New_: - -``` -Exception exception = new Exception("custom error"); -SentryEvent event = new SentryEvent(exception); -event.setLevel(SentryLevel.ERROR); -Sentry.captureEvent(event); -``` - -#### Capture a message - -_Old_: - -``` -Sentry.capture("This is a test"); -``` - -_New_: - -``` -Sentry.captureMessage("This is a test"); // SentryLevel.INFO by default -Sentry.captureMessage("This is a test", SentryLevel.WARNING); // or specific level -``` - -#### Breadcrumbs - -_Old_: - -``` -Sentry.getContext().recordBreadcrumb( - new BreadcrumbBuilder().setMessage("User made an action").build() -); -``` - -_New_: - -``` -Sentry.addBreadcrumb("User made an action"); -``` - -#### User - -_Old_: - -``` -Sentry.getContext().setUser( - new UserBuilder().setEmail("hello@sentry.io").build() -); -``` - -_New_: - -``` -User user = new User(); -user.setEmail("hello@sentry.io"); -Sentry.setUser(user); -``` - -#### Set extra - -_Old_: - -``` -Sentry.getContext().addExtra("extra", "thing"); -``` - -_New_: - -``` -Sentry.setExtra("extra", "thing"); -``` diff --git a/REVIEWS.md b/REVIEWS.md index 4fc27faebd6..b414c08d94b 100644 --- a/REVIEWS.md +++ b/REVIEWS.md @@ -58,7 +58,7 @@ rule file in [`.cursor/rules/`](.cursor/rules) for the area the diff touches (`a - New public API must be intentional: new classes/methods not for public use need `@ApiStatus.Internal`, new unstable API needs `@ApiStatus.Experimental`. - Removing or changing the signature of public API, or silently changing a default, sampling rate, - or feature toggle, without a deprecation and a `CHANGELOG.md`/`MIGRATION.md` note. + or feature toggle, without a deprecation and a `CHANGELOG.md` note. - New features must be **opt-in by default** via `SentryOptions` (or a namespaced options class). If a feature is added without this, ask "are you sure" as a PR comment. - New fields on `io.sentry.protocol` classes need both serialization and deserialization, plus a