Skip to content

Commit 99f0220

Browse files
committed
docs(agents): Document the pre-publish requirements for new modules
1 parent 7485097 commit 99f0220

2 files changed

Lines changed: 54 additions & 12 deletions

File tree

‎.cursor/rules/new_module.mdc‎

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,15 @@ val SENTRY_FOO_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.foo"
3939
The module's `build.gradle.kts` consumes it in both `buildConfig` and the jar manifest
4040
(`Sentry-SDK-Name` / `Sentry-SDK-Package-Name`) — see `sentry-kafka/build.gradle.kts`.
4141

42-
4. Add the instrumented library to `gradle/libs.versions.toml` and depend on it with
42+
4. For an Android module, add the artifact id to `Config.BuildScript.androidLibs` in
43+
`buildSrc/src/main/java/Config.kt`. This makes the generated POM of any module that depends
44+
on it declare `<type>aar</type>`, which Gradle otherwise gets wrong
45+
([gradle#3170](https://github.com/gradle/gradle/issues/3170)).
46+
47+
5. Add the instrumented library to `gradle/libs.versions.toml` and depend on it with
4348
`compileOnly(libs.<lib>)`, so the integration does not force the dependency on users.
4449

45-
5. Register the integration with the SDK so it is reported in the `sdk` payload. Every
50+
6. Register the integration with the SDK so it is reported in the `sdk` payload. Every
4651
integration does this — see `sentry-openfeature/.../SentryOpenFeatureHook.java`:
4752

4853
```java
@@ -54,7 +59,7 @@ static {
5459
addIntegrationToSdkVersion("{IntegrationName}");
5560
```
5661

57-
6. If adding a JVM sample, add E2E (system) tests, following the structure we have in the existing JVM examples.
62+
7. If adding a JVM sample, add E2E (system) tests, following the structure we have in the existing JVM examples.
5863
The test should then be added to `test/system-test-runner.py` and `.github/workflows/system-tests-backend.yml`.
5964

6065
`sentry-bom` and the root `build.gradle.kts` need no change — they iterate over subprojects.
@@ -97,18 +102,35 @@ Add the necessary documentation to [docs.sentry.io](https://docs.sentry.io):
97102
- For Android modules: Add to Android platform docs, usually in integrations section
98103
- Include installation instructions, configuration options, and usage examples
99104

100-
### 6. Post release tasks
105+
### 6. Add the Module to `.craft.yml`
106+
107+
This is **not** a post-release task. It has to be merged before the release that first ships the
108+
module, otherwise that release publishes to Maven Central and then aborts on the `registry`
109+
target, leaving *every* `io.sentry` artifact stale in the release registry — not just the new one.
110+
111+
Add the module to the `registry` target in `.craft.yml`, carrying all four metadata fields. The
112+
simplest way is to copy the block of a neighbouring module and swap the name:
113+
114+
```yaml
115+
sdks:
116+
# ... existing modules ...
117+
maven:io.sentry:sentry-{module-name}:
118+
name: io.sentry:sentry-{module-name}
119+
packageUrl: https://central.sonatype.com/artifact/io.sentry/sentry-{module-name}
120+
mainDocsUrl: https://docs.sentry.io/platforms/{android|java}/integrations/{module-name}/
121+
apiDocsUrl: https://javadoc.io/doc/io.sentry
122+
```
101123

102-
Remind the user to perform the following tasks after the module is merged and released:
124+
Craft reads these fields only for a package it has not published before — for anything already in
125+
the registry it carries the existing manifest forward. A missing `name` therefore fails the whole
126+
registry target rather than just that entry, and only on the release that first ships the module.
127+
`mainDocsUrl` must be a live page, so step 5 has to be merged first.
103128

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)
129+
No hand-editing of [sentry-release-registry](https://github.com/getsentry/sentry-release-registry)
130+
is needed: with these fields present, craft creates the registry entry by itself.
105131

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-
```
132+
The fields are authoritative — craft writes them over the registry manifest on every release, so
133+
do not change an existing entry's values unless the change is intended to be published.
112134

113135
## Module Naming Conventions
114136

‎AGENTS.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,26 @@ The repository is organized into multiple modules:
121121
- **Transport Layer**: Pluggable transport implementations for different environments
122122
- **Scope Management**: Thread-safe scope/context management for error tracking
123123

124+
### Requirements for New Modules Before They Can Be Published
125+
126+
Read the `new_module` rule for the full procedure; this is the subset that, if missed, is not
127+
caught locally. Every item must land **before** the release that first ships the module.
128+
129+
1. The module is in the include list in `settings.gradle.kts`
130+
2. The module has a row in the packages table in `README.md` (the Maven Central badge stays
131+
broken until the first release)
132+
3. Android (AAR) modules are listed in `Config.BuildScript.androidLibs` in
133+
`buildSrc/src/main/java/Config.kt`, so the generated POM of any module depending on it
134+
declares `<type>aar</type>`
135+
4. The module is in the integrations dropdown of `.github/ISSUE_TEMPLATE/bug_report_java.yml`,
136+
or `bug_report_android.yml` for an Android module
137+
5. The module has an entry in the `registry` target of `.craft.yml` carrying `name`,
138+
`packageUrl`, `mainDocsUrl` and `apiDocsUrl`. Craft reads these only for a package it has
139+
not published before, and a missing `name` fails the **whole** registry target rather than
140+
just that entry — so the release publishes to Maven Central and then leaves every artifact
141+
stale in the release registry. `mainDocsUrl` must be a live docs.sentry.io page, which means
142+
the docs change has to be merged first.
143+
124144
## Development Guidelines
125145

126146
### Code Style

0 commit comments

Comments
 (0)