Skip to content

Commit 17e76d7

Browse files
committed
Merge branch 'main' into feat/profiling-cursor-rules
2 parents 66095e3 + 62b579c commit 17e76d7

File tree

79 files changed

+721
-543
lines changed

Some content is hidden

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

79 files changed

+721
-543
lines changed

.claude/skills/create-java-pr/SKILL.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Derive the branch name from the changes being made. Use `feat/`, `fix/`, `ref/`,
3535

3636
**For stacked PRs:** For the first PR in a new stack, first create and push the collection branch (see `.cursor/rules/pr.mdc` § "Creating the Collection Branch"), then branch the PR off it. For subsequent PRs, branch off the previous stack branch. Use the naming conventions from `.cursor/rules/pr.mdc` § "Branch Naming".
3737

38+
**CRITICAL: Never merge, fast-forward, or push commits into the collection branch.** It stays at its initial position until the user merges stack PRs through GitHub. Updating it will auto-merge and destroy the entire PR stack.
39+
3840
## Step 2: Format Code and Regenerate API Files
3941

4042
```bash
@@ -111,14 +113,21 @@ Fill in each section based on the changes being PR'd. Check any checklist items
111113
- Pass `--base <previous-stack-branch>` so the PR targets the previous branch (first PR in a stack targets the collection branch).
112114
- Use the stacked PR title format: `<type>(<scope>): [<Topic> <N>] <Subject>` (see `.cursor/rules/pr.mdc` § "PR Title Naming").
113115
- Include the stack list at the top of the PR body, before the `## :scroll: Description` section (see `.cursor/rules/pr.mdc` § "Stack List in PR Description" for the format).
116+
- Add a merge method reminder at the very end of the PR body (see `.cursor/rules/pr.mdc` § "Stack List in PR Description" for the exact text). This only applies to stack PRs, not the collection branch PR.
114117

115118
Then continue to Step 5.5 (stacked PRs only) or Step 6.
116119

117120
## Step 5.5: Update Stack List on All PRs (stacked PRs only)
118121

119122
Skip this step for standalone PRs.
120123

121-
After creating the PR, update the PR description on **every other PR in the stack** so all PRs have the same up-to-date stack list. Follow the format and commands in `.cursor/rules/pr.mdc` § "Stack List in PR Description".
124+
After creating the PR, update the PR description on **every other PR in the stack — including the collection branch PR** — so all PRs have the same up-to-date stack list. Follow the format and commands in `.cursor/rules/pr.mdc` § "Stack List in PR Description".
125+
126+
**Important:** When updating PR bodies, never use shell redirects (`>`, `>>`) or pipes (`|`) or compound commands (`&&`). These create compound shell expressions that won't match permission patterns. Instead:
127+
- Use `gh pr view <NUMBER> --json body --jq '.body'` to get the body (output returned directly)
128+
- Use the `Write` tool to save it to a temp file
129+
- Use the `Edit` tool to modify the temp file
130+
- Use `gh pr edit <NUMBER> --body-file /tmp/pr-body.md` to update
122131

123132
## Step 6: Update Changelog
124133

@@ -170,8 +179,6 @@ git push
170179

171180
If no changelog entry is needed, add `#skip-changelog` to the PR description to disable the changelog CI check:
172181

173-
```bash
174-
gh pr view <PR_NUMBER> --json body --jq '.body' > /tmp/pr-body.md
175-
printf '\n#skip-changelog\n' >> /tmp/pr-body.md
176-
gh pr edit <PR_NUMBER> --body-file /tmp/pr-body.md
177-
```
182+
1. Get the current body: `gh pr view <PR_NUMBER> --json body --jq '.body'`
183+
2. Use the `Write` tool to save the output to `/tmp/pr-body.md`, appending `\n#skip-changelog\n` at the end
184+
3. Update: `gh pr edit <PR_NUMBER> --body-file /tmp/pr-body.md`

.cursor/rules/pr.mdc

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ git push -u origin HEAD
185185
gh pr create --base main --draft --title "<type>(<scope>): <Topic>" --body "Collection PR for the <Topic> stack. Squash-merge this once all stack PRs are merged."
186186
```
187187

188+
**CRITICAL: Do NOT manually update the collection branch.** Never merge, fast-forward, or push stack branch commits into the collection branch. The collection branch stays at its initial position (the empty commit on `main`) until the user merges individual stack PRs into it one by one through GitHub. If you fast-forward the collection branch to include stack commits, GitHub will auto-merge and delete all stack PR branches, destroying the entire stack.
189+
188190
### Creating a New Stacked PR
189191

190192
1. Start from the tip of the previous stack branch (or the collection branch for the first PR).
@@ -197,35 +199,37 @@ gh pr create --base main --draft --title "<type>(<scope>): <Topic>" --body "Coll
197199

198200
### Stack List in PR Description
199201

200-
Every PR in the stack must have a stack list **at the top of its description** (before the `## :scroll: Description` section). When a new PR is added, update the description on **all** PRs in the stack.
202+
Every PR in the stack — **including the collection branch PR** — must have a stack list **at the top of its description** (before the `## :scroll: Description` section). When a new PR is added, update the description on **all** PRs in the stack and on the collection branch PR.
201203

202204
Format:
203205

204206
```markdown
205207
## PR Stack (<Topic>)
206208

207-
- [#5118](https://github.com/getsentry/sentry-java/pull/5118) — Add scope-level attributes API
208-
- [#5120](https://github.com/getsentry/sentry-java/pull/5120) — Wire scope attributes into LoggerApi and MetricsApi
209-
- [#5121](https://github.com/getsentry/sentry-java/pull/5121) — Showcase scope attributes in Spring Boot 4 samples
209+
- #5118
210+
- #5120
211+
- #5121
210212

211213
---
212214
```
213215

214216
No status column — GitHub already shows that. The `---` separates the stack list from the rest of the PR description.
215217

216-
To update the PR description, use `--body-file` to avoid shell quoting issues with special characters in the body:
218+
**Merge method reminder:** On stack PRs (not the collection branch PR), add the following line at the very end of the PR description:
217219

218-
```bash
219-
# Get current PR description into a temp file
220-
gh pr view <PR_NUMBER> --json body --jq '.body' > /tmp/pr-body.md
220+
```markdown
221+
> ⚠️ **Merge this PR using a merge commit** (not squash). Only the collection branch is squash-merged into main.
222+
```
221223

222-
# Edit /tmp/pr-body.md to prepend or replace the stack list section
223-
# (replace everything from "## PR Stack" up to and including the "---" separator,
224-
# or prepend before the existing description if no stack list exists yet)
224+
This does not apply to standalone PRs or the collection branch PR.
225225

226-
# Update the description
227-
gh pr edit <PR_NUMBER> --body-file /tmp/pr-body.md
228-
```
226+
To update the PR description, use `--body-file` to avoid shell quoting issues with special characters in the body.
227+
228+
**Important:** Do not use shell redirects (`>`, `>>`, `|`) or compound commands (`&&`, `||`). These create compound shell expressions that won't match permission patterns. Instead, use the `Write` and `Edit` tools for file manipulation:
229+
230+
1. Read the current body with `gh pr view <PR_NUMBER> --json body --jq '.body'` (the output is returned directly — use the `Write` tool to save it to `/tmp/pr-body.md`)
231+
2. Use the `Edit` tool to prepend or replace the stack list section in `/tmp/pr-body.md`
232+
3. Update the description: `gh pr edit <PR_NUMBER> --body-file /tmp/pr-body.md`
229233

230234
### Merging Stacked PRs (done by the user, not the agent)
231235

@@ -237,12 +241,12 @@ Once all stack PRs are merged into the collection branch, the collection PR is *
237241

238242
### Syncing the Stack
239243

240-
When a base PR changes (e.g. after addressing review feedback on PR 1), merge the changes forward through the stack:
244+
When a base PR changes (e.g. after addressing review feedback on PR 1), merge the changes forward through the stack **between adjacent stack PR branches only**:
241245

242246
```bash
243247
# On the branch for PR 2
244248
git checkout feat/scope-attributes-logger
245-
git merge feat/scope-attributes
249+
git merge feat/scope-attributes-api
246250
git push
247251

248252
# On the branch for PR 3
@@ -251,4 +255,6 @@ git merge feat/scope-attributes-logger
251255
git push
252256
```
253257

258+
**Never merge into the collection branch.** Syncing only happens between stack PR branches. The collection branch is untouched until the user merges PRs through GitHub.
259+
254260
Prefer merge over rebase — it preserves commit history, doesn't invalidate existing review comments, and avoids the need for force-pushing. Only rebase if explicitly requested.

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @adinauer @romtsn @markushi @lcian
1+
* @adinauer @romtsn @markushi
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Check Tombstone Proto Schema
2+
3+
on:
4+
schedule:
5+
- cron: '0 9 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v6
14+
15+
- name: Check for newer Tombstone proto schema
16+
run: ./scripts/check-tombstone-proto-schema.sh

CHANGELOG.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Changelog
22

3+
## 8.35.0
4+
5+
### Fixes
6+
7+
- Android: Remove the dependency on protobuf-lite for tombstones ([#5157](https://github.com/getsentry/sentry-java/pull/5157))
8+
9+
### Features
10+
11+
- Add new experimental option to capture profiles for ANRs ([#4899](https://github.com/getsentry/sentry-java/pull/4899))
12+
- This feature will capture a stack profile of the main thread when it gets unresponsive
13+
- The profile gets attached to the ANR event on the next app start, providing a flamegraph of the ANR issue on the sentry issue details page
14+
- Enable via `options.setAnrProfilingSampleRate(<sample-rate>)` or AndroidManifest.xml: `<meta-data android:name="io.sentry.anr.profiling.sample-rate" android:value="[0.0-1.0]" />`
15+
- The sample rate controls the probability of collecting a profile for each detected foreground ANR (0.0 to 1.0, null to disable)
16+
17+
### Behavioral Changes
18+
19+
- Add `enableAnrFingerprinting` option which assigns static fingerprints to ANR events with system-only stacktraces
20+
- When enabled, ANRs whose stacktraces contain only system frames (e.g. `java.lang` or `android.os`) are grouped into a single issue instead of creating many separate issues
21+
- This will help to reduce overall ANR issue noise in the Sentry dashboard
22+
- **IMPORTANT:** This option is enabled by default.
23+
- Disable via `options.setEnableAnrFingerprinting(false)` or AndroidManifest.xml: `<meta-data android:name="io.sentry.anr.enable-fingerprinting" android:value="false" />`
24+
325
## 8.34.1
426

527
### Fixes
@@ -45,14 +67,6 @@
4567
<meta-data android:name="io.sentry.screenshot.mask-all-images" android:value="true" />
4668
```
4769
- The `ManifestMetaDataReader` now read the `DIST` ([#5107](https://github.com/getsentry/sentry-java/pull/5107))
48-
- Add new experimental option to capture profiles for ANRs ([#4899](https://github.com/getsentry/sentry-java/pull/4899))
49-
- This feature will capture a stack profile of the main thread when it gets unresponsive
50-
- The profile gets attached to the ANR event on the next app start, providing a flamegraph of the ANR issue on the sentry issue details page
51-
- Enable via `options.setAnrProfilingSampleRate(<sample-rate>)` or AndroidManifest.xml: `<meta-data android:name="io.sentry.anr.profiling.sample-rate" android:value="[0.0-1.0]" />`
52-
- The sample rate controls the probability of collecting a profile for each detected foreground ANR (0.0 to 1.0, null to disable)
53-
- Add `enableAnrFingerprinting` option to reduce ANR noise by assigning static fingerprints to ANR events with system-only stacktraces
54-
- When enabled, ANRs whose stacktraces contain only system frames (e.g. `java.lang` or `android.os`) are grouped into a single issue instead of creating many separate issues
55-
- Enable via `options.setEnableAnrFingerprinting(true)` or AndroidManifest.xml: `<meta-data android:name="io.sentry.anr.enable-fingerprinting" android:value="true" />`
5670

5771
### Fixes
5872

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.34.1
15+
versionName=8.35.0
1616

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

gradle/libs.versions.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ spotless = "7.0.4"
4141
gummyBears = "0.12.0"
4242
camerax = "1.3.0"
4343
openfeature = "1.18.2"
44-
protobuf = "3.25.8"
4544

4645
[plugins]
4746
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
@@ -61,7 +60,6 @@ spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
6160
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.23.8" }
6261
jacoco-android = { id = "com.mxalbert.gradle.jacoco-android", version = "0.2.0" }
6362
kover = { id = "org.jetbrains.kotlinx.kover", version = "0.7.3" }
64-
protobuf = { id = "com.google.protobuf", version = "0.9.5" }
6563
vanniktech-maven-publish = { id = "com.vanniktech.maven.publish", version = "0.30.0" }
6664
springboot2 = { id = "org.springframework.boot", version.ref = "springboot2" }
6765
springboot3 = { id = "org.springframework.boot", version.ref = "springboot3" }
@@ -145,8 +143,7 @@ otel-javaagent-extension-api = { module = "io.opentelemetry.javaagent:openteleme
145143
otel-semconv = { module = "io.opentelemetry.semconv:opentelemetry-semconv", version.ref = "otelSemanticConventions" }
146144
otel-semconv-incubating = { module = "io.opentelemetry.semconv:opentelemetry-semconv-incubating", version.ref = "otelSemanticConventionsAlpha" }
147145
p6spy = { module = "p6spy:p6spy", version = "3.9.1" }
148-
protobuf-javalite = { module = "com.google.protobuf:protobuf-javalite", version.ref = "protobuf"}
149-
protoc = { module = "com.google.protobuf:protoc", version.ref = "protobuf" }
146+
epitaph = { module = "com.abovevacant:epitaph", version = "0.1.0" }
150147
quartz = { module = "org.quartz-scheduler:quartz", version = "2.3.0" }
151148
reactor-core = { module = "io.projectreactor:reactor-core", version = "3.5.3" }
152149
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
TRACKED_COMMIT="981d145117e8992842cdddee555c57e60c7a220a"
5+
6+
# tail -n +2 to remove the magic anti-XSSI prefix from the Gitiles JSON response
7+
LATEST_COMMIT=$(curl -sf \
8+
'https://android.googlesource.com/platform/system/core/+log/refs/heads/main/debuggerd/proto/tombstone.proto?format=JSON' \
9+
| tail -n +2 \
10+
| jq -r '.log[0].commit')
11+
12+
if [ -z "$LATEST_COMMIT" ] || [ "$LATEST_COMMIT" = "null" ]; then
13+
echo "ERROR: Failed to fetch latest commit from Gitiles" >&2
14+
exit 1
15+
fi
16+
17+
echo "Tracked commit: $TRACKED_COMMIT"
18+
echo "Latest commit: $LATEST_COMMIT"
19+
20+
if [ "$LATEST_COMMIT" != "$TRACKED_COMMIT" ]; then
21+
echo "Schema has been updated! Latest: https://android.googlesource.com/platform/system/core/+/${LATEST_COMMIT}/debuggerd/proto/tombstone.proto"
22+
exit 1
23+
fi
24+
25+
echo "Schema is up to date."

sentry-android-core/build.gradle.kts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ plugins {
88
alias(libs.plugins.jacoco.android)
99
alias(libs.plugins.errorprone)
1010
alias(libs.plugins.gradle.versions)
11-
alias(libs.plugins.protobuf)
1211
}
1312

1413
android {
@@ -84,7 +83,7 @@ dependencies {
8483
implementation(libs.androidx.lifecycle.common.java8)
8584
implementation(libs.androidx.lifecycle.process)
8685
implementation(libs.androidx.core)
87-
implementation(libs.protobuf.javalite)
86+
implementation(libs.epitaph)
8887

8988
errorprone(libs.errorprone.core)
9089
errorprone(libs.nopen.checker)
@@ -113,10 +112,3 @@ dependencies {
113112
testRuntimeOnly(libs.androidx.fragment.ktx)
114113
testRuntimeOnly(libs.timber)
115114
}
116-
117-
protobuf {
118-
protoc { artifact = libs.protoc.get().toString() }
119-
generateProtoTasks {
120-
all().forEach { task -> task.builtins { create("java") { option("lite") } } }
121-
}
122-
}

sentry-android-core/proguard-rules.pro

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@
5454

5555
-keepnames class io.sentry.android.core.ApplicationNotResponding
5656

57-
# protobuf-java lite
58-
# https://github.com/protocolbuffers/protobuf/blob/5d876c9fec1a6f2feb0750694f803f89312bffff/java/lite.md#r8-rule-to-make-production-app-builds-work
59-
-keep class * extends com.google.protobuf.GeneratedMessageLite { *; }
6057

6158
##---------------End: proguard configuration for android-core ----------
6259

0 commit comments

Comments
 (0)