chore: remove dead BindableSentryOptions.EnableTracing - #5605
Conversation
The property survived the removal of SentryOptions.EnableTracing in #3569, so an "EnableTracing" key under "Sentry" in appsettings.json still bound and was then silently discarded. Three samples still advertised the key; they now use TracesSampleRate. BindableProperties_MatchOptionsProperties now also asserts the other direction — every bindable property must have a matching property on the options class — so the next removal can't leave one behind. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5605 +/- ##
==========================================
- Coverage 74.85% 74.85% -0.01%
==========================================
Files 515 515
Lines 18963 18962 -1
Branches 3694 3694
==========================================
- Hits 14195 14194 -1
Misses 3891 3891
Partials 877 877 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
@ric-oliv this PR is entirely LLM generated but it's also pretty straight forward and mechanical.
The only complex part of it is the change to the tests, which have failed to catch this for some time.
This unfortunately touches one of the pieces of code in the solution that I'm least proud of - I never managed to make these tests very easy to understand or read and so I apologise in advance if it's hard to get your head around them. Maybe we add a chore to the repo to tidy them up at some point.
One thing that might help is this high level context for why we has Bindable properties in the first place:
https://blog.sentry.io/should-you-could-you-aot/#configuration-bindings-7
There was a problem hiding this comment.
Totally fair, and the tests actually don't look bad! 🙂
also thanks for the blog link!
Summary
BindableSentryOptions.EnableTracingoutlived the option it bound to: edd6564 (#3569)removed
SentryOptions.EnableTracingand dropped the assignment fromApplyTo, but left thebindable property in place.
"Sentry": { "EnableTracing": true }in appsettings.json thereforestill bound successfully and was then silently discarded — and three samples still advertised
the key. Those now use
TracesSampleRate, which is what #3569 pointed users at.BindableSentryOptionsisinternal, so nothing here is a public API change.I swept the other bindable classes —
BindableSentryLoggingOptions,BindableSentryAspNetCoreOptions,BindableSentryMauiOptions, and the Android/Cocoa partialsunder
src/Sentry/Platforms/— andEnableTracingwas the only leftover of this kind. Thenative
EnableTracingon the Android and CocoaNativeOptionsis a different, still-liveoption and is untouched.
BindableProperties_MatchOptionsPropertiesonly asserted one direction: every bindable optionis declared on the bindable class. It now asserts both, so a bindable property with no matching
property on the options class fails the test rather than quietly binding into a void. The
options side of that check uses non-public bindings too —
SentryAspNetCoreOptions.FlushBeforeRequestCompletedis
internaland is a legitimate binding target.Note for review
Not fixed here, but worth flagging: in
BindableSentryOptions.NativeOptions.ApplyTo(Android),ExperimentalOptions.SessionReplay.RedactAllText/RedactAllImagesare assigned from theoptions object rather than to it, so those two config keys are also discarded. They're
non-nullable
bool, so unlikeEnableTracingthe fix isn't a deletion — applying them changesbehaviour for anyone setting them, which belongs in its own PR. The new assertion doesn't reach
them either: it compares top-level properties only, and the existing tests skip
ExperimentalOptions.#skip-changelog
🤖 Generated with Claude Code