Skip to content

Commit e8671f2

Browse files
authored
Merge branch 'main' into lcian/feat/ktor-client
2 parents 38220c9 + 70671a5 commit e8671f2

File tree

50 files changed

+1893
-141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1893
-141
lines changed

.cursor/rules/coding.mdc

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
alwaysApply: true
3+
description: Cursor Coding Rules
4+
---
5+
6+
# Contributing Rules for Agents
7+
8+
## Overview
9+
10+
sentry-java is the Java and Android SDK for Sentry. This repository contains the source code and examples for SDK usage.
11+
12+
## Tech Stack
13+
14+
- **Language**: Java and Kotlin
15+
- **Build Framework**: Gradle
16+
17+
## Key Commands
18+
19+
```bash
20+
# Format code and regenerate .api files
21+
./gradlew spotlessApply apiDump
22+
23+
# Run all tests and linter
24+
./gradlew check
25+
26+
# Run unit tests for a specific file
27+
./gradle ':<module>:testDebugUnitTest' --tests="*<file name>*" --info
28+
```
29+
30+
## Contributing Guidelines
31+
32+
1. Follow existing code style and language
33+
2. Do not modify the API files (e.g. sentry.api) manually, instead run `./gradlew apiDump` to regenerate them
34+
3. Write comprehensive tests
35+
4. New features should always be opt-in by default, extend `SentryOptions` or similar Option classes with getters and setters to enable/disable a new feature
36+
5. Consider backwards compatibility
37+
38+
## Coding rules
39+
40+
1. First think through the problem, read the codebase for relevant files, and propose a plan
41+
2. Before you begin working, check in with me and I will verify the plan
42+
3. Then, begin working on the todo items, marking them as complete as you go
43+
4. Please do not describe every step of the way and just give me a high level explanation of what changes you made
44+
5. Make every task and code change you do as simple as possible. We want to avoid making any massive or complex changes. Every change should impact as little code as possible. Everything is about simplicity.
45+
6. Once you're done, format the code and regenerate the .api files using the following command `./gradlew spotlessApply apiDump`
46+
7. As a last step, git stage the relevant files and propose (but not execute) a single git commit command (e.g. `git commit -m "<git commit message>"`)
47+
48+
49+
## Useful Resources
50+
51+
- Main SDK documentation: https://develop.sentry.dev/sdk/overview/
52+
- Internal contributing guide: https://docs.sentry.io/internal/contributing/
53+
- Git commit messages conventions: https://develop.sentry.dev/engineering-practices/commit-messages/

.envrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export VIRTUAL_ENV=".venv"
2+
layout python3

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

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,39 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
sample: [ "sentry-samples-spring-boot-jakarta" ]
24-
agent: [ "0" ]
24+
agent: [ "false" ]
2525
agent-auto-init: [ "true" ]
2626
include:
2727
- sample: "sentry-samples-spring-boot"
28+
agent: "false"
29+
agent-auto-init: "true"
2830
- sample: "sentry-samples-spring-boot-opentelemetry-noagent"
31+
agent: "false"
32+
agent-auto-init: "true"
2933
- sample: "sentry-samples-spring-boot-opentelemetry"
30-
agent: "1"
34+
agent: "true"
3135
agent-auto-init: "true"
3236
- sample: "sentry-samples-spring-boot-opentelemetry"
33-
agent: "1"
37+
agent: "true"
3438
agent-auto-init: "false"
3539
- sample: "sentry-samples-spring-boot-webflux-jakarta"
40+
agent: "false"
41+
agent-auto-init: "true"
3642
- sample: "sentry-samples-spring-boot-webflux"
43+
agent: "false"
44+
agent-auto-init: "true"
3745
- sample: "sentry-samples-spring-boot-jakarta-opentelemetry-noagent"
46+
agent: "false"
47+
agent-auto-init: "true"
3848
- sample: "sentry-samples-spring-boot-jakarta-opentelemetry"
39-
agent: "1"
49+
agent: "true"
4050
agent-auto-init: "true"
4151
- sample: "sentry-samples-spring-boot-jakarta-opentelemetry"
42-
agent: "1"
52+
agent: "true"
4353
agent-auto-init: "false"
54+
- sample: "sentry-samples-console"
55+
agent: "false"
56+
agent-auto-init: "true"
4457
steps:
4558
- uses: actions/checkout@v4
4659
with:
@@ -50,6 +63,11 @@ jobs:
5063
with:
5164
python-version: '3.10.5'
5265

66+
- name: Install Python dependencies
67+
run: |
68+
python3 -m pip install --upgrade pip
69+
python3 -m pip install -r requirements.txt
70+
5371
- name: Set up Java
5472
uses: actions/setup-java@v4
5573
with:
@@ -90,17 +108,9 @@ jobs:
90108
-e '/.*"sentry-samples-android",/d' \
91109
build.gradle.kts
92110
93-
- name: Build server jar
94-
run: |
95-
./gradlew :sentry-samples:${{ matrix.sample }}:bootJar
96-
97-
- name: Build agent jar
98-
run: |
99-
./gradlew :sentry-opentelemetry:sentry-opentelemetry-agent:assemble
100-
101-
- name: Start server and run integration test for sentry-cli commands
111+
- name: Build and run system tests
102112
run: |
103-
test/system-test-run.sh "${{ matrix.sample }}" "${{ matrix.agent }}" "${{ matrix.agent-auto-init }}" "0"
113+
python3 test/system-test-runner.py test --module "${{ matrix.sample }}" --agent "${{ matrix.agent }}" --auto-init "${{ matrix.agent-auto-init }}" --build "true"
104114
105115
- name: Upload test results
106116
if: always()

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@ distributions/
2020
*.vscode/
2121
sentry-spring-boot-starter-jakarta/src/main/resources/META-INF/spring.factories
2222
sentry-samples/sentry-samples-spring-boot-jakarta/spy.log
23+
sentry-mock-server.txt
24+
spring-server.txt
2325
spy.log
2426
.kotlin

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
### Features
66

7+
- Add `SentryUserFeedbackButton` Composable ([#4559](https://github.com/getsentry/sentry-java/pull/4559))
8+
- Also added `Sentry.showUserFeedbackDialog` static method
9+
- Add deadlineTimeout option ([#4555](https://github.com/getsentry/sentry-java/pull/4555))
710
- Add Ktor client integration ([#4527](https://github.com/getsentry/sentry-java/pull/4527))
811
- To use the integration, add a dependency on `io.sentry:sentry-ktor-client`, then install the `SentryKtorClientPlugin` on your `HttpClient`,
912
e.g.:
@@ -21,6 +24,8 @@
2124
### Fixes
2225

2326
- Allow multiple UncaughtExceptionHandlerIntegrations to be active at the same time ([#4462](https://github.com/getsentry/sentry-java/pull/4462))
27+
- Prevent repeated scroll target determination during a single scroll gesture ([#4557](https://github.com/getsentry/sentry-java/pull/4557))
28+
- This should reduce the number of ANRs seen in `SentryGestureListener`
2429

2530
## 8.17.0
2631

Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: all clean compile javadocs dryRelease update checkFormat api assembleBenchmarkTestRelease assembleUiTestRelease assembleUiTestCriticalRelease createCoverageReports runUiTestCritical check preMerge publish
1+
.PHONY: all clean compile javadocs dryRelease update checkFormat api assembleBenchmarkTestRelease assembleUiTestRelease assembleUiTestCriticalRelease createCoverageReports runUiTestCritical setupPython systemTest systemTestInteractive check preMerge publish
22

33
all: stop clean javadocs compile createCoverageReports
44
assembleBenchmarks: assembleBenchmarkTestRelease
@@ -10,6 +10,7 @@ publish: clean dryRelease
1010
clean:
1111
./gradlew clean --no-configuration-cache
1212
rm -rf distributions
13+
rm -rf .venv
1314

1415
# build and run tests
1516
compile:
@@ -59,6 +60,20 @@ createCoverageReports:
5960
./gradlew jacocoTestReport
6061
./gradlew koverXmlReportRelease
6162

63+
# Create the Python virtual environment for system tests, and install the necessary dependencies
64+
setupPython:
65+
@test -d .venv || python3 -m venv .venv
66+
.venv/bin/pip install --upgrade pip
67+
.venv/bin/pip install -r requirements.txt
68+
69+
# Run system tests for sample applications
70+
systemTest: setupPython
71+
.venv/bin/python test/system-test-runner.py test --all
72+
73+
# Run system tests with interactive module selection
74+
systemTestInteractive: setupPython
75+
.venv/bin/python test/system-test-runner.py test --interactive
76+
6277
# Run tests and lint
6378
check:
6479
./gradlew check

requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
certifi==2025.7.14
2+
charset-normalizer==3.4.2
3+
idna==3.10
4+
requests==2.32.4
5+
urllib3==2.5.0

sentry-android-core/api/sentry-android-core.api

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ public class io/sentry/android/core/SentryUserFeedbackDialog$Builder {
404404
public fun <init> (Landroid/content/Context;I)V
405405
public fun <init> (Landroid/content/Context;ILio/sentry/android/core/SentryUserFeedbackDialog$OptionsConfiguration;)V
406406
public fun <init> (Landroid/content/Context;Lio/sentry/android/core/SentryUserFeedbackDialog$OptionsConfiguration;)V
407+
public fun associatedEventId (Lio/sentry/protocol/SentryId;)Lio/sentry/android/core/SentryUserFeedbackDialog$Builder;
408+
public fun configurator (Lio/sentry/SentryFeedbackOptions$OptionsConfigurator;)Lio/sentry/android/core/SentryUserFeedbackDialog$Builder;
407409
public fun create ()Lio/sentry/android/core/SentryUserFeedbackDialog;
408410
}
409411

sentry-android-core/src/main/java/io/sentry/android/core/ActivityLifecycleIntegration.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,12 @@ private void startTracing(final @NotNull Activity activity) {
189189
}
190190

191191
final TransactionOptions transactionOptions = new TransactionOptions();
192+
193+
// Set deadline timeout based on configured option
194+
final long deadlineTimeoutMillis = options.getDeadlineTimeout();
195+
// No deadline when zero or negative value is set
192196
transactionOptions.setDeadlineTimeout(
193-
TransactionOptions.DEFAULT_DEADLINE_TIMEOUT_AUTO_TRANSACTION);
197+
deadlineTimeoutMillis <= 0 ? null : deadlineTimeoutMillis);
194198

195199
if (options.isEnableActivityLifecycleTracingAutoFinish()) {
196200
transactionOptions.setIdleTimeout(options.getIdleTimeout());

sentry-android-core/src/main/java/io/sentry/android/core/AndroidOptionsInitializer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,9 @@ static void installDefaultIntegrations(
389389
options.addIntegration(replay);
390390
options.setReplayController(replay);
391391
}
392+
options
393+
.getFeedbackOptions()
394+
.setDialogHandler(new SentryAndroidOptions.AndroidUserFeedbackIDialogHandler());
392395
}
393396

394397
/**

0 commit comments

Comments
 (0)