You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 13094aa
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .cursor/rules/new_module.mdc
+22-24Lines changed: 22 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,19 @@ alwaysApply: false
8
8
9
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
10
11
+
## Publishing Gate
12
+
13
+
Nothing below is enforced by the build, so a module can look finished, pass CI, and still break
14
+
the release that first ships it. All of the following have to be merged **before** that release:
15
+
16
+
- The module is in the include list in `settings.gradle.kts` (step 1.2)
17
+
- Android (AAR) modules are in `Config.BuildScript.androidLibs` (step 1.4)
18
+
- The module has a row in the packages table in the main `README.md` (step 3)
19
+
- The module is in the integrations dropdown of the matching issue template (step 4)
20
+
- The docs page exists on docs.sentry.io (step 5), because `.craft.yml` has to point at a live URL
21
+
- The module has a full entry in the `registry` target of `.craft.yml` (step 6) — **this one
22
+
fails the release itself**, not just the module
23
+
11
24
## Step-by-Step Process
12
25
13
26
### 1. Create the Module Structure
@@ -39,10 +52,12 @@ val SENTRY_FOO_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.foo"
39
52
The module's `build.gradle.kts` consumes it in both `buildConfig` and the jar manifest
40
53
(`Sentry-SDK-Name` / `Sentry-SDK-Package-Name`) — see `sentry-kafka/build.gradle.kts`.
41
54
42
-
4. Add the instrumented library to `gradle/libs.versions.toml` and depend on it with
55
+
4. For an Android module, add the artifact id to `androidLibs` in `buildSrc/src/main/java/Config.kt`.
56
+
57
+
5. Add the instrumented library to `gradle/libs.versions.toml` and depend on it with
43
58
`compileOnly(libs.<lib>)`, so the integration does not force the dependency on users.
44
59
45
-
5. Register the integration with the SDK so it is reported in the `sdk` payload. Every
60
+
6. Register the integration with the SDK so it is reported in the `sdk` payload. Every
46
61
integration does this — see `sentry-openfeature/.../SentryOpenFeatureHook.java`:
47
62
48
63
```java
@@ -54,24 +69,16 @@ static {
54
69
addIntegrationToSdkVersion("{IntegrationName}");
55
70
```
56
71
57
-
6. If adding a JVM sample, add E2E (system) tests, following the structure we have in the existing JVM examples.
72
+
7. If adding a JVM sample, add E2E (system) tests, following the structure we have in the existing JVM examples.
58
73
The test should then be added to `test/system-test-runner.py` and `.github/workflows/system-tests-backend.yml`.
59
74
60
75
`sentry-bom` and the root `build.gradle.kts` need no change — they iterate over subprojects.
61
76
62
77
### 2. Create Module Documentation
63
78
64
-
Create a `README.md` in the module directory with the following structure:
65
-
66
-
```markdown
67
-
# sentry-{module-name}
79
+
Create a `README.md` in the module directory: the module name as the heading, what it instruments, and a high level overview.
68
80
69
-
This module provides an integration for [Technology/Framework Name].
70
-
71
-
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}/).
72
-
```
73
-
74
-
The following tasks are required only when adding a module that isn't a sample.
81
+
Steps 3 to 6 are required only when adding a module that isn't a sample.
75
82
76
83
### 3. Update Main README.md
77
84
@@ -97,18 +104,9 @@ Add the necessary documentation to [docs.sentry.io](https://docs.sentry.io):
97
104
- For Android modules: Add to Android platform docs, usually in integrations section
98
105
- Include installation instructions, configuration options, and usage examples
99
106
100
-
### 6. Post release tasks
101
-
102
-
Remind the user to perform the following tasks after the module is merged and released:
103
-
104
-
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)
107
+
### 6. Add the Module to `.craft.yml`
105
108
106
-
2. Add the module to `.craft.yml` in the `sdks` section:
107
-
```yaml
108
-
sdks:
109
-
# ... existing modules ...
110
-
maven:io.sentry:sentry-{module-name}:
111
-
```
109
+
Add the module to the `registry` target in `.craft.yml`, including all metadata fields.
0 commit comments