Skip to content

Commit beac27d

Browse files
committed
docs(agents): Refresh new_module rule and cover full system-test runs
Validating the previous commit with agents surfaced two gaps. `new_module.mdc` had drifted from the repo. Its README badge snippet still used the retired maven-badges.herokuapp.com format, while every current row in README.md uses shields.io with a central.sonatype.com link. It also never mentioned four steps that every existing integration module performs: the `SENTRY_*_SDK_NAME` constant in `Config.kt` consumed by buildConfig and the jar manifest, the `libs.versions.toml` entry paired with a `compileOnly` dependency, self-registration via `SentryIntegrationPackageStorage.addPackage` and `addIntegrationToSdkVersion`, and the integrations dropdown in the issue template. It now also points at `sentry-kafka` and `sentry-android-timber` as build-script templates, and records that `sentry-bom` and the root build file need no change because they iterate over subprojects. The `test` skill only ever ran a single module, so folding the AGENTS.md testing block into it dropped the only reference to running the whole system test suite. Step 3b now covers `make systemTest` and `make systemTestInteractive`.
1 parent 736bdaf commit beac27d

2 files changed

Lines changed: 50 additions & 6 deletions

File tree

.claude/skills/test/SKILL.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ test -d .venv || make setupPython
7878

7979
This starts the mock Sentry server, starts the sample app (Spring Boot/Tomcat/CLI), runs tests via `./gradlew :sentry-samples:<sample-module>:systemTest`, and cleans up afterwards.
8080

81+
To run **every** system test instead of one module, use the Makefile targets — they also create the
82+
venv for you:
83+
84+
```bash
85+
make systemTest # all system tests (--all)
86+
make systemTestInteractive # pick the setups to run (--interactive)
87+
```
88+
8189
## Step 4: Report Results
8290

8391
Summarize the test outcome:

.cursor/rules/new_module.mdc

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ This document outlines the complete process for adding a new module to the sentr
1212

1313
### 1. Create the Module Structure
1414

15-
1. Create the new module, conforming to the existing naming conventions and build scripts
15+
1. Create the new module, conforming to the existing naming conventions and build scripts.
16+
Copy the `build.gradle.kts` of the closest existing integration rather than writing one from
17+
scratch — `sentry-kafka` is a good JVM template, `sentry-android-timber` a good Android one.
1618

1719
2. Add the module to the include list in `settings.gradle.kts`
1820

@@ -27,9 +29,36 @@ ignoredProjects.addAll(
2729
)
2830
```
2931

30-
3. If adding a JVM sample, add E2E (system) tests, following the structure we have in the existing JVM examples.
32+
3. Add a `SENTRY_{MODULE}_SDK_NAME` constant to the `Config.Sentry` block in
33+
`buildSrc/src/main/java/Config.kt`:
34+
35+
```kotlin
36+
val SENTRY_FOO_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.foo"
37+
```
38+
39+
The module's `build.gradle.kts` consumes it in both `buildConfig` and the jar manifest
40+
(`Sentry-SDK-Name` / `Sentry-SDK-Package-Name`) — see `sentry-kafka/build.gradle.kts`.
41+
42+
4. Add the instrumented library to `gradle/libs.versions.toml` and depend on it with
43+
`compileOnly(libs.<lib>)`, so the integration does not force the dependency on users.
44+
45+
5. Register the integration with the SDK so it is reported in the `sdk` payload. Every
46+
integration does this — see `sentry-openfeature/.../SentryOpenFeatureHook.java`:
47+
48+
```java
49+
static {
50+
SentryIntegrationPackageStorage.getInstance()
51+
.addPackage("maven:io.sentry:sentry-{module-name}", BuildConfig.VERSION_NAME);
52+
}
53+
// then, from the constructor:
54+
addIntegrationToSdkVersion("{IntegrationName}");
55+
```
56+
57+
6. If adding a JVM sample, add E2E (system) tests, following the structure we have in the existing JVM examples.
3158
The test should then be added to `test/system-test-runner.py` and `.github/workflows/system-tests-backend.yml`.
3259

60+
`sentry-bom` and the root `build.gradle.kts` need no change — they iterate over subprojects.
61+
3362
### 2. Create Module Documentation
3463

3564
Create a `README.md` in the module directory with the following structure:
@@ -46,22 +75,29 @@ The following tasks are required only when adding a module that isn't a sample.
4675

4776
### 3. Update Main README.md
4877

49-
Add the new module to the packages table in the main `README.md` with a placeholder link to the badge:
78+
Add the new module to the packages table in the main `README.md`. Copy the row of a neighbouring
79+
module and swap the name — Android modules carry a third column for the min API level, JVM modules
80+
do not:
5081

5182
```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}) | |
83+
| sentry-{module-name} | [![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-{module-name}?style=for-the-badge&logo=sentry&color=green)](https://central.sonatype.com/artifact/io.sentry/sentry-{module-name}) |
5384
```
5485

5586
Note that the badge will only work after the module is released to Maven Central.
5687

57-
### 4. Add Documentation to docs.sentry.io
88+
### 4. Add the Module to the Issue Template
89+
90+
Add `- sentry-{module-name}` to the integrations dropdown in
91+
`.github/ISSUE_TEMPLATE/bug_report_java.yml`, or `bug_report_android.yml` for an Android module.
92+
93+
### 5. Add Documentation to docs.sentry.io
5894

5995
Add the necessary documentation to [docs.sentry.io](https://docs.sentry.io):
6096
- For Java modules: Add to Java platform docs, usually in integrations section
6197
- For Android modules: Add to Android platform docs, usually in integrations section
6298
- Include installation instructions, configuration options, and usage examples
6399

64-
### 5. Post release tasks
100+
### 6. Post release tasks
65101

66102
Remind the user to perform the following tasks after the module is merged and released:
67103

0 commit comments

Comments
 (0)