Skip to content

feat(snapshots): Add @SentrySnapshot runtime annotation (EME-1055)#1154

Open
runningcode wants to merge 1 commit intomainfrom
no/eme-1055-sentry-snapshot-annotation
Open

feat(snapshots): Add @SentrySnapshot runtime annotation (EME-1055)#1154
runningcode wants to merge 1 commit intomainfrom
no/eme-1055-sentry-snapshot-annotation

Conversation

@runningcode
Copy link
Copy Markdown
Contributor

@runningcode runningcode commented Apr 17, 2026

Summary

  • Adds a new Maven artifact io.sentry:sentry-snapshots-runtime publishing the @SentrySnapshot annotation. Consumers apply it alongside @Preview to set a per-snapshot diffThreshold.
  • Published as a new included build at sentry-snapshots-runtime/, parallel to sentry-kotlin-compiler-plugin, and registered in .craft.yml.
  • Scoped to only the annotation artifact. A follow-up will wire the Gradle plugin's preview scanner (PreviewMethodScanner) to read it and surface diffThreshold in the sidecar JSON written by GenerateSnapshotTestsTask.

Resolves part 1 of EME-1055.

🤖 Generated with Claude Code

Introduce a new Maven artifact io.sentry:sentry-snapshots-runtime
that publishes the @SentrySnapshot annotation. Consumers apply it
alongside @Preview to override the global diff threshold on a
per-snapshot basis.

The diffThreshold parameter name aligns with the --diff-threshold
flag in sentry-cli and the diff_threshold field in the snapshot
manifest, giving consistent naming across CLI, manifest, and the
Android runtime.

A follow-up will wire the Gradle plugin's preview scanner to read
the annotation and surface the value in per-snapshot sidecar
metadata.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 17, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 17, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (snapshots) Add @SentrySnapshot runtime annotation (EME-1055) by runningcode in #1154

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- Add @SentrySnapshot runtime annotation (EME-1055) ([#1154](https://github.com/getsentry/sentry-android-gradle-plugin/pull/1154))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against d12022c

@@ -0,0 +1,58 @@
plugins {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copied from the sentry-kotlin-compiler-plugin but simplified a bit

@@ -0,0 +1,24 @@
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1536m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:+CrashOnOutOfMemoryError
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, copied from the sentry-kotlin-compiler-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants