diff --git a/.cursor/rules/api.mdc b/.cursor/rules/api.mdc index 4a9e3629c77..3e5f0b461d9 100644 --- a/.cursor/rules/api.mdc +++ b/.cursor/rules/api.mdc @@ -12,6 +12,8 @@ Public API is tracked via `.api` files generated by the [ABI validation](https:/ - `./gradlew check` validates current code against `.api` files and fails on unintended changes. - `@ApiStatus.Internal` marks classes/methods as internal — they still appear in `.api` files but are not part of the public contract. - `@ApiStatus.Experimental` marks API that may change in future versions. +- `@HybridSdkApi` marks non-customer API that a hybrid SDK (React Native, Flutter, .NET, Unity, Unreal, Godot, KMP, Capacitor) uses. Add it to new API that a hybrid SDK calls, and to an element a hybrid SDK calls when you mark it `@ApiStatus.Internal`. Customer-facing API doesn't need it. +- Before changing, moving, or removing an element marked `@HybridSdkApi`, find the hybrid SDKs that use it and coordinate with their teams. They often call it through bindings, JNI, or reflection by name, so no compiler catches the break. ## Key Public API Classes diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index baa2dad44a2..4566fcc4a64 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -28,7 +28,7 @@ Include a link to Sentry when applicable: - [ ] I updated the wizard if needed. - [ ] Review from the native team if needed. - [ ] No breaking change or entry added to the changelog. -- [ ] No breaking change for hybrid SDKs or communicated to hybrid SDKs. +- [ ] No breaking change for hybrid SDKs or communicated to hybrid SDKs. New API for hybrid SDKs is marked `@HybridSdkApi`. - [ ] Public API changes reviewed by another Mobile SDK team member or implemented according to the [develop docs](https://develop.sentry.dev/) spec. diff --git a/AGENTS.md b/AGENTS.md index 35f4c7177fc..50236e66546 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,7 +9,7 @@ rule file in `.cursor/rules/`: | Rule | Read it when working on | |---|---| -| `api` | Public API surface, binary compatibility, `.api` files, `updateKotlinAbi`, `IScope`/`IScopes`/`Sentry` static API, protocol classes | +| `api` | Public API surface, binary compatibility, `.api` files, `updateKotlinAbi`, `@HybridSdkApi`, API for hybrid SDKs, `IScope`/`IScopes`/`Sentry` static API, protocol classes | | `options` | `SentryOptions`, namespaced options, `ExternalOptions`, `sentry.properties`, `ManifestMetadataReader`, Spring Boot properties | | `scopes` | Scope management, forking, lifecycle, `ScopeType`, thread-local storage, scope bleeding, Hub → Scopes migration | | `deduplication` | Duplicate event detection, `DuplicateEventDetectionEventProcessor`, `enableDeduplication` | diff --git a/REVIEWS.md b/REVIEWS.md index 4fc27faebd6..a5f4a1f4fae 100644 --- a/REVIEWS.md +++ b/REVIEWS.md @@ -57,6 +57,9 @@ 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`. +- Non-customer API added for a hybrid SDK (React Native, Flutter, .NET, Unity, ...) needs + `@HybridSdkApi`. Changing, moving, or removing an element marked `@HybridSdkApi` needs a callout + that the hybrid SDK teams using it were told. - 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. - New features must be **opt-in by default** via `SentryOptions` (or a namespaced options class).