Skip to content

Commit 072c7c3

Browse files
committed
Merge remote-tracking branch 'origin/main' into antonis/feedback-shake-runtime
# Conflicts: # sentry-android-core/src/main/java/io/sentry/android/core/FeedbackShakeIntegration.java # sentry-android-core/src/test/java/io/sentry/android/core/FeedbackShakeIntegrationTest.kt
2 parents dcb0f90 + 23b2680 commit 072c7c3

38 files changed

+943
-107
lines changed

.agents/skills

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.claude/skills

.claude/skills/test/SKILL.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
name: test
3+
description: Run tests for a specific SDK module. Use when asked to "run tests", "test module", "run unit tests", "run system tests", "run e2e tests", or test a specific class. Auto-detects unit vs system tests. Supports interactive mode.
4+
allowed-tools: Bash, Read, Glob, AskUserQuestion
5+
argument-hint: [interactive] <module-name-or-file-path> [test-class-filter]
6+
---
7+
8+
# Run Tests
9+
10+
Run tests for a specific module. Auto-detects whether to run unit tests or system tests.
11+
12+
## Step 0: Check for Interactive Mode
13+
14+
If `$ARGUMENTS` starts with `interactive` (e.g., `/test interactive sentry ScopesTest`), enable interactive mode. Strip the `interactive` keyword from the arguments before proceeding.
15+
16+
In interactive mode, use AskUserQuestion at decision points as described in the steps below.
17+
18+
## Step 1: Parse the Argument
19+
20+
The argument can be either:
21+
- A **file path** (e.g., `@sentry/src/test/java/io/sentry/ScopesTest.kt`)
22+
- A **module name** (e.g., `sentry-android-core`, `sentry-samples-spring-boot-4`)
23+
- A **module name + test filter** (e.g., `sentry ScopesTest`)
24+
25+
Extract the module name and optional test class filter from the argument.
26+
27+
**Interactive mode:** If the test filter is ambiguous (e.g., matches multiple test classes across modules), use AskUserQuestion to let the user pick which test class(es) to run.
28+
29+
## Step 2: Detect Test Type
30+
31+
| Signal | Test Type |
32+
|--------|-----------|
33+
| Path contains `sentry-samples/` | System test |
34+
| Module name starts with `sentry-samples-` | System test |
35+
| Everything else | Unit test |
36+
37+
## Step 3a: Run Unit Tests
38+
39+
Determine the Gradle test task:
40+
41+
| Module Pattern | Test Task |
42+
|---------------|-----------|
43+
| `sentry-android-*` | `testDebugUnitTest` |
44+
| `sentry-compose*` | `testDebugUnitTest` |
45+
| `*-android` | `testDebugUnitTest` |
46+
| Everything else | `test` |
47+
48+
**Interactive mode:** Before running, read the test class file and use AskUserQuestion to ask:
49+
- "Run all tests in this class, or a specific method?" — list the test method names as options.
50+
51+
If the user picks a specific method, use `--tests="*ClassName.methodName"` as the filter.
52+
53+
With a test class filter:
54+
```bash
55+
./gradlew ':<module>:<task>' --tests="*<filter>*" --info
56+
```
57+
58+
Without a filter:
59+
```bash
60+
./gradlew ':<module>:<task>' --info
61+
```
62+
63+
## Step 3b: Run System Tests
64+
65+
System tests require the Python-based test runner which manages a mock Sentry server and sample app lifecycle.
66+
67+
1. Ensure the Python venv exists:
68+
```bash
69+
test -d .venv || make setupPython
70+
```
71+
72+
2. Extract the sample module name. For file paths like `sentry-samples/<sample-module>/src/...`, the sample module is the directory name (e.g., `sentry-samples-spring`).
73+
74+
3. Run the system test:
75+
```bash
76+
.venv/bin/python test/system-test-runner.py test --module <sample-module>
77+
```
78+
79+
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.
80+
81+
## Step 4: Report Results
82+
83+
Summarize the test outcome:
84+
- Total tests run, passed, failed, skipped
85+
- For failures: show the failing test name and the assertion/error message

.github/workflows/integration-tests-benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
run: ./gradlew :sentry-android-integration-tests:test-app-sentry:assembleRelease
107107

108108
- name: Collect app metrics
109-
uses: getsentry/action-app-sdk-overhead-metrics@v1
109+
uses: getsentry/action-app-sdk-overhead-metrics@ecce2e2718b6d97ad62220fca05627900b061ed5
110110
with:
111111
config: sentry-android-integration-tests/metrics-test.yml
112112
sauce-user: ${{ secrets.SAUCE_USERNAME }}

.github/workflows/spring-boot-4-matrix.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,13 @@ jobs:
132132
--auto-init "false" \
133133
--build "true"
134134
135-
# needs a fix in opentelemetry-spring-boot-starter
136-
# - name: Run sentry-samples-spring-boot-4-opentelemetry-noagent
137-
# run: |
138-
# python3 test/system-test-runner.py test \
139-
# --module "sentry-samples-spring-boot-4-opentelemetry-noagent" \
140-
# --agent false \
141-
# --auto-init "true" \
142-
# --build "true"
135+
- name: Run sentry-samples-spring-boot-4-opentelemetry-noagent
136+
run: |
137+
python3 test/system-test-runner.py test \
138+
--module "sentry-samples-spring-boot-4-opentelemetry-noagent" \
139+
--agent false \
140+
--auto-init "true" \
141+
--build "true"
143142
144143
- name: Run sentry-samples-spring-7
145144
run: |

.github/workflows/system-tests-backend.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ jobs:
7272
- sample: "sentry-samples-spring-boot-4-webflux"
7373
agent: "false"
7474
agent-auto-init: "true"
75-
# - sample: "sentry-samples-spring-boot-4-opentelemetry-noagent"
76-
# agent: "false"
77-
# agent-auto-init: "true"
75+
- sample: "sentry-samples-spring-boot-4-opentelemetry-noagent"
76+
agent: "false"
77+
agent-auto-init: "true"
7878
- sample: "sentry-samples-spring-boot-4-opentelemetry"
7979
agent: "true"
8080
agent-auto-init: "true"

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ local.properties
1313
**/sentry-native-local
1414
target/
1515
.classpath
16+
.factorypath
1617
.project
1718
.settings/
1819
bin/
@@ -30,5 +31,6 @@ spy.log
3031
**/tomcat.8080/webapps/
3132
**/__pycache__
3233

33-
# Local Claude Code settings that should not be committed
34+
# Local Claude Code settings/state that should not be committed
3435
.claude/settings.local.json
36+
.claude/worktrees/

.pi/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"skills": [
3+
"../.claude/skills"
4+
],
5+
"enableSkillCommands": true
6+
}

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,45 @@
1010

1111
### Fixes
1212

13+
- Session Replay: Fix Compose text masking mismatch with weighted text ([#5218](https://github.com/getsentry/sentry-java/pull/5218))
14+
15+
### Features
16+
17+
- Add configurable `IScopesStorageFactory` to `SentryOptions` for providing a custom `IScopesStorage`, e.g. when the default `ThreadLocal`-backed storage is incompatible with non-pinning thread models ([#5199](https://github.com/getsentry/sentry-java/pull/5199))
18+
- Android: Add `beforeErrorSampling` callback to Session Replay ([#5214](https://github.com/getsentry/sentry-java/pull/5214))
19+
- Allows filtering which errors trigger replay capture before the `onErrorSampleRate` is checked
20+
- Returning `false` skips replay capture entirely for that error; returning `true` proceeds with the normal sample rate check
21+
- Example usage:
22+
```java
23+
SentryAndroid.init(context) { options ->
24+
options.sessionReplay.beforeErrorSampling =
25+
SentryReplayOptions.BeforeErrorSamplingCallback { event, hint ->
26+
// Skip replay for handled exceptions
27+
val hasUnhandled = event.exceptions?.any { it.mechanism?.isHandled == false } == true
28+
hasUnhandled
29+
}
30+
}
31+
```
32+
33+
### Dependencies
34+
35+
- Bump OpenTelemetry ([#5225](https://github.com/getsentry/sentry-java/pull/5225))
36+
- `opentelemetry` to `1.60.1` (was `1.57.0`)
37+
- `opentelemetry-instrumentation` to `2.26.0` (was `2.23.0`)
38+
- `opentelemetry-instrumentation-alpha` to `2.26.0-alpha` (was `2.23.0-alpha`)
39+
- `opentelemetry-semconv` to `1.40.0` (was `1.37.0`)
40+
- `opentelemetry-semconv-alpha` to `1.40.0-alpha` (was `1.37.0-alpha`)
41+
42+
## 8.36.0
43+
44+
### Features
45+
46+
- Show feedback form on device shake ([#5150](https://github.com/getsentry/sentry-java/pull/5150))
47+
- Enable via `options.getFeedbackOptions().setUseShakeGesture(true)` or manifest meta-data `io.sentry.feedback.use-shake-gesture`
48+
- Uses the device's accelerometer — no special permissions required
49+
50+
### Fixes
51+
1352
- Support masking/unmasking and click/scroll detection for Jetpack Compose 1.10+ ([#5189](https://github.com/getsentry/sentry-java/pull/5189))
1453

1554
### Dependencies

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ android.useAndroidX=true
1212
android.experimental.lint.version=8.9.0
1313

1414
# Release information
15-
versionName=8.35.0
15+
versionName=8.36.0
1616

1717
# Override the SDK name on native crashes on Android
1818
sentryAndroidSdkName=sentry.native.android

gradle/libs.versions.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ nopen = "1.0.1"
2222
# see https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compatibility-and-versioning.html#kotlin-compatibility
2323
# see https://developer.android.com/jetpack/androidx/releases/compose-kotlin
2424
okhttp = "4.9.2"
25-
otel = "1.57.0"
26-
otelInstrumentation = "2.23.0"
27-
otelInstrumentationAlpha = "2.23.0-alpha"
25+
otel = "1.60.1"
26+
otelInstrumentation = "2.26.0"
27+
otelInstrumentationAlpha = "2.26.0-alpha"
2828
# check https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/dependencyManagement/build.gradle.kts#L49 for release version above to find a compatible version
29-
otelSemanticConventions = "1.37.0"
30-
otelSemanticConventionsAlpha = "1.37.0-alpha"
29+
otelSemanticConventions = "1.40.0"
30+
otelSemanticConventionsAlpha = "1.40.0-alpha"
3131
retrofit = "2.9.0"
3232
slf4j = "1.7.30"
3333
springboot2 = "2.7.18"
@@ -148,7 +148,7 @@ quartz = { module = "org.quartz-scheduler:quartz", version = "2.3.0" }
148148
reactor-core = { module = "io.projectreactor:reactor-core", version = "3.5.3" }
149149
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
150150
retrofit-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "retrofit" }
151-
sentry-native-ndk = { module = "io.sentry:sentry-native-ndk", version = "0.13.2" }
151+
sentry-native-ndk = { module = "io.sentry:sentry-native-ndk", version = "0.13.3" }
152152
servlet-api = { module = "javax.servlet:javax.servlet-api", version = "3.1.0" }
153153
servlet-jakarta-api = { module = "jakarta.servlet:jakarta.servlet-api", version = "6.1.0" }
154154
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }

0 commit comments

Comments
 (0)