Skip to content

Commit ae6bba5

Browse files
committed
docs(rules): Correct the new-module rule and its publishing gate
1 parent 99f0220 commit ae6bba5

2 files changed

Lines changed: 26 additions & 32 deletions

File tree

‎.cursor/rules/new_module.mdc‎

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ alwaysApply: false
88

99
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.
1010

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+
1124
## Step-by-Step Process
1225

1326
### 1. Create the Module Structure
@@ -66,17 +79,13 @@ addIntegrationToSdkVersion("{IntegrationName}");
6679

6780
### 2. Create Module Documentation
6881

69-
Create a `README.md` in the module directory with the following structure:
70-
71-
```markdown
72-
# sentry-{module-name}
82+
Create a `README.md` in the module directory: the module name as the heading, what it instruments,
83+
the entry points a host app touches, and a link to the module's page on docs.sentry.io. Take that
84+
link from the page itself rather than assembling it from the module name — a module does not always
85+
get its own page (`sentry-android-navigation3` is documented inside the existing Navigation page).
86+
`sentry-android-navigation3/README.md` is a good example.
7387

74-
This module provides an integration for [Technology/Framework Name].
75-
76-
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}/).
77-
```
78-
79-
The following tasks are required only when adding a module that isn't a sample.
88+
Steps 3 to 6 are required only when adding a module that isn't a sample.
8089

8190
### 3. Update Main README.md
8291

@@ -102,6 +111,11 @@ Add the necessary documentation to [docs.sentry.io](https://docs.sentry.io):
102111
- For Android modules: Add to Android platform docs, usually in integrations section
103112
- Include installation instructions, configuration options, and usage examples
104113

114+
This has to be merged before step 6, which needs the live URL. The path is not derivable from the
115+
module name — integrations sit under `integrations/`, instrumentation under
116+
`tracing/instrumentation/`, and some modules are documented inside an existing page instead of
117+
getting their own. Note the URL the page actually resolves to, with no redirect.
118+
105119
### 6. Add the Module to `.craft.yml`
106120

107121
This is **not** a post-release task. It has to be merged before the release that first ships the
@@ -117,14 +131,14 @@ sdks:
117131
maven:io.sentry:sentry-{module-name}:
118132
name: io.sentry:sentry-{module-name}
119133
packageUrl: https://central.sonatype.com/artifact/io.sentry/sentry-{module-name}
120-
mainDocsUrl: https://docs.sentry.io/platforms/{android|java}/integrations/{module-name}/
134+
mainDocsUrl: {the live docs.sentry.io URL from step 5}
121135
apiDocsUrl: https://javadoc.io/doc/io.sentry
122136
```
123137

124138
Craft reads these fields only for a package it has not published before — for anything already in
125139
the registry it carries the existing manifest forward. A missing `name` therefore fails the whole
126140
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.
141+
That is why a bare `maven:io.sentry:sentry-{module-name}:` key appears to work and then does not.
128142

129143
No hand-editing of [sentry-release-registry](https://github.com/getsentry/sentry-release-registry)
130144
is needed: with these fields present, craft creates the registry entry by itself.

‎AGENTS.md‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -121,26 +121,6 @@ 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-
144124
## Development Guidelines
145125

146126
### Code Style

0 commit comments

Comments
 (0)