Skip to content

Commit 1309d92

Browse files
authored
Merge branch 'main' into lcian/checkin-api-experimental
2 parents 678817b + d919915 commit 1309d92

File tree

10 files changed

+114
-0
lines changed

10 files changed

+114
-0
lines changed

.cursor/rules/new_module.mdc

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
description: Module Addition Rules for sentry-java
3+
alwaysApply: false
4+
---
5+
# Module Addition Rules for sentry-java
6+
7+
## Overview
8+
9+
This document outlines the complete process for adding a new module to the sentry-java repository. Follow these steps in order to ensure proper integration and release management.
10+
11+
## Step-by-Step Process
12+
13+
### 1. Create the Module Structure
14+
15+
1. Create the new module, conforming to the existing naming conventions and build scripts
16+
17+
2. Add the module to the include list in `settings.gradle.kts`
18+
19+
If adding a `sentry-samples` module, also add it to the `ignoredProjects` list in the root `build.gradle.kts`:
20+
21+
```kotlin
22+
ignoredProjects.addAll(
23+
listOf(
24+
// ... existing projects ...
25+
"sentry-samples-{module-name}"
26+
)
27+
)
28+
```
29+
30+
3. If adding a JVM sample, add E2E (system) tests, following the structure we have in the existing JVM examples.
31+
The test should then be added to `test/system-test-runner.py` and `.github/workflows/system-tests-backend.yml`.
32+
33+
### 2. Create Module Documentation
34+
35+
Create a `README.md` in the module directory with the following structure:
36+
37+
```markdown
38+
# sentry-{module-name}
39+
40+
This module provides an integration for [Technology/Framework Name].
41+
42+
Please consult the documentation on how to install and use this integration in the Sentry Docs for [Android](https://docs.sentry.io/platforms/android/integrations/{module-name}/) or [Java](https://docs.sentry.io/platforms/java/tracing/instrumentation/{module-name}/).
43+
```
44+
45+
The following tasks are required only when adding a module that isn't a sample.
46+
47+
### 3. Update Main README.md
48+
49+
Add the new module to the packages table in the main `README.md` with a placeholder link to the badge:
50+
51+
```markdown
52+
| sentry-{module-name} | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-{module-name}/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-{module-name}) | |
53+
```
54+
55+
Note that the badge will only work after the module is released to Maven Central.
56+
57+
### 4. Add Documentation to docs.sentry.io
58+
59+
Add the necessary documentation to [docs.sentry.io](https://docs.sentry.io):
60+
- For Java modules: Add to Java platform docs, usually in integrations section
61+
- For Android modules: Add to Android platform docs, usually in integrations section
62+
- Include installation instructions, configuration options, and usage examples
63+
64+
### 5. Post release tasks
65+
66+
Remind the user to perform the following tasks after the module is merged and released:
67+
68+
1. Add the SDK to the Sentry release registry, following the instructions in the [sentry-release-registry README](https://github.com/getsentry/sentry-release-registry#adding-new-sdks)
69+
70+
2. Add the module to `.craft.yml` in the `sdks` section:
71+
```yaml
72+
sdks:
73+
# ... existing modules ...
74+
maven:io.sentry:sentry-{module-name}:
75+
```
76+
77+
## Module Naming Conventions
78+
79+
- Use kebab-case for module names: `sentry-{module-name}`
80+
- Follow existing patterns: `sentry-okhttp`, `sentry-apollo-4`, `sentry-spring-boot`
81+
- For version-specific modules, include the version: `sentry-apollo-3`, `sentry-apollo-4`
82+
83+
## Important Notes
84+
85+
1. **API Files**: Do not modify `.api` files manually. Run `./gradlew apiDump` to regenerate them
86+
2. **Backwards Compatibility**: Ensure new features are opt-in by default
87+
3. **Testing**: Write comprehensive tests for all new functionality
88+
4. **Documentation**: Always include proper documentation and examples

.cursor/rules/overview_dev.mdc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ Use the `fetch_rules` tool to include these rules when working on specific areas
4242
- `OtelSpanFactory`, `SentrySpanExporter`
4343
- Tracing, distributed tracing
4444

45+
- **`new_module`**: Use when adding a new integration or sample module
46+
4547
### Testing
4648
- **`e2e_tests`**: Use when working with:
4749
- System tests, sample applications
@@ -58,5 +60,6 @@ Use the `fetch_rules` tool to include these rules when working on specific areas
5860
- Scope/Hub/forking → `scopes`
5961
- Duplicate/dedup → `deduplication`
6062
- OpenTelemetry/tracing/spans → `opentelemetry`
63+
- new module/integration/sample → `new_module`
6164
- Cache/offline/network → `offline`
6265
- System test/e2e/sample → `e2e_tests`

.github/pull_request_template.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@
66
<!--- Why is this change required? What problem does it solve? -->
77
<!--- If it fixes an open issue, please link to the issue here. -->
88

9+
<!--
10+
* resolves: #1234
11+
* resolves: LIN-1234
12+
-->
913

1014
## :green_heart: How did you test it?
1115

1216

1317
## :pencil: Checklist
1418
<!--- Put an `x` in the boxes that apply -->
1519

20+
- [ ] I added GH Issue ID _&_ Linear ID
1621
- [ ] I added tests to verify the changes.
1722
- [ ] No new PII added or SDK only sends newly added PII if `sendDefaultPII` is enabled.
1823
- [ ] I updated the docs if needed.

sentry-android-distribution/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ androidComponents.beforeVariants {
2525

2626
dependencies {
2727
implementation(projects.sentry)
28+
implementation(
29+
libs.jetbrains.annotations
30+
) // Use implementation instead of compileOnly to override kotlin stdlib's version
2831
implementation(kotlin(Config.kotlinStdLib, Config.kotlinStdLibVersionAndroid))
2932
}

sentry-android-distribution/src/main/java/io/sentry/android/distribution/DistributionIntegration.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ import io.sentry.Integration
99
import io.sentry.SentryOptions
1010
import io.sentry.UpdateInfo
1111
import io.sentry.UpdateStatus
12+
import org.jetbrains.annotations.ApiStatus
1213

1314
/**
1415
* The public Android SDK for Sentry Build Distribution.
1516
*
1617
* Provides functionality to check for app updates and download new versions from Sentry's preprod
1718
* artifacts system.
1819
*/
20+
@ApiStatus.Experimental
1921
public class DistributionIntegration(context: Context) : Integration, IDistributionApi {
2022

2123
private lateinit var scopes: IScopes

sentry/src/main/java/io/sentry/IDistributionApi.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.sentry;
22

3+
import org.jetbrains.annotations.ApiStatus;
34
import org.jetbrains.annotations.NotNull;
45

56
/**
@@ -8,6 +9,7 @@
89
* <p>Provides methods to check for app updates and download new versions from Sentry's preprod
910
* artifacts system.
1011
*/
12+
@ApiStatus.Experimental
1113
public interface IDistributionApi {
1214

1315
/**

sentry/src/main/java/io/sentry/NoOpDistributionApi.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package io.sentry;
22

3+
import org.jetbrains.annotations.ApiStatus;
34
import org.jetbrains.annotations.NotNull;
45

56
/** No-op implementation of IDistributionApi. Used when distribution module is not available. */
7+
@ApiStatus.Experimental
68
public final class NoOpDistributionApi implements IDistributionApi {
79

810
private static final NoOpDistributionApi instance = new NoOpDistributionApi();

sentry/src/main/java/io/sentry/SentryOptions.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ public class SentryOptions {
602602
* SentryAndroidOptions, but there's a circular dependency issue between sentry-android-core and
603603
* sentry-android-distribution modules.
604604
*/
605+
@ApiStatus.Experimental
605606
public static final class DistributionOptions {
606607
/** Organization authentication token for API access */
607608
public String orgAuthToken = "";
@@ -2848,10 +2849,12 @@ public void setReplayController(final @Nullable ReplayController replayControlle
28482849
replayController != null ? replayController : NoOpReplayController.getInstance();
28492850
}
28502851

2852+
@ApiStatus.Experimental
28512853
public @NotNull IDistributionApi getDistributionController() {
28522854
return distributionController;
28532855
}
28542856

2857+
@ApiStatus.Experimental
28552858
public void setDistributionController(final @Nullable IDistributionApi distributionController) {
28562859
this.distributionController =
28572860
distributionController != null ? distributionController : NoOpDistributionApi.getInstance();
@@ -3567,10 +3570,12 @@ public interface BeforeSendLogCallback {
35673570
}
35683571
}
35693572

3573+
@ApiStatus.Experimental
35703574
public @NotNull DistributionOptions getDistribution() {
35713575
return distribution;
35723576
}
35733577

3578+
@ApiStatus.Experimental
35743579
public void setDistribution(final @NotNull DistributionOptions distribution) {
35753580
this.distribution = distribution != null ? distribution : new DistributionOptions();
35763581
}

sentry/src/main/java/io/sentry/UpdateInfo.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package io.sentry;
22

3+
import org.jetbrains.annotations.ApiStatus;
34
import org.jetbrains.annotations.NotNull;
45

56
/** Information about an available app update. */
7+
@ApiStatus.Experimental
68
public final class UpdateInfo {
79
private final @NotNull String id;
810
private final @NotNull String buildVersion;

sentry/src/main/java/io/sentry/UpdateStatus.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package io.sentry;
22

3+
import org.jetbrains.annotations.ApiStatus;
34
import org.jetbrains.annotations.NotNull;
45

56
/** Represents the result of checking for app updates. */
7+
@ApiStatus.Experimental
68
public abstract class UpdateStatus {
79

810
/** Current app version is up to date, no update available. */

0 commit comments

Comments
 (0)