Skip to content

ref(options): Delegate deserialization to serde instead of generating it per-field#550

Draft
jan-auer wants to merge 1 commit into
mainfrom
ref/serde-based-options-deserialization
Draft

ref(options): Delegate deserialization to serde instead of generating it per-field#550
jan-auer wants to merge 1 commit into
mainfrom
ref/serde-based-options-deserialization

Conversation

@jan-auer

@jan-auer jan-auer commented Jul 9, 2026

Copy link
Copy Markdown
Member

The SentryOptions derive macro previously generated a deserialize method that called options.get() for each struct field individually. This meant the proc macro owned all deserialization logic, including a custom #[sentry_options(rename)] attribute for field renames.

Deserialization is now a provided default method on the SentryOptions trait: it parses the embedded schema to discover property keys, fetches each value, and delegates to serde_json::from_value for the actual struct construction. Options structs must derive serde::Deserialize, and field renames use standard #[serde(rename)].

The derive macro is reduced to emitting only the two constants (NAMESPACE, SCHEMA) and the singleton/refresh glue.

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.58%. Comparing base (d49434e) to head (88d9b13).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
objectstore-options/src/lib.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #550      +/-   ##
==========================================
+ Coverage   87.41%   87.58%   +0.16%     
==========================================
  Files          92       93       +1     
  Lines       14695    14819     +124     
==========================================
+ Hits        12846    12979     +133     
+ Misses       1849     1840       -9     
Components Coverage Δ
Rust Backend 92.18% <ø> (ø)
Rust Client 79.89% <ø> (ø)
Python Client 88.87% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant