Skip to content

chore: remove dead BindableSentryOptions.EnableTracing - #5605

Merged
jamescrosswell merged 1 commit into
mainfrom
chore/remove-dead-bindable-props
Sep 22, 2026
Merged

jamescrosswell merged 1 commit into
mainfrom
chore/remove-dead-bindable-props

Conversation

@jamescrosswell

Copy link
Copy Markdown
Collaborator

Summary

BindableSentryOptions.EnableTracing outlived the option it bound to: edd6564 (#3569)
removed SentryOptions.EnableTracing and dropped the assignment from ApplyTo, but left the
bindable property in place. "Sentry": { "EnableTracing": true } in appsettings.json therefore
still 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.

BindableSentryOptions is internal, so nothing here is a public API change.

I swept the other bindable classes — BindableSentryLoggingOptions,
BindableSentryAspNetCoreOptions, BindableSentryMauiOptions, and the Android/Cocoa partials
under src/Sentry/Platforms/ — and EnableTracing was the only leftover of this kind. The
native EnableTracing on the Android and Cocoa NativeOptions is a different, still-live
option and is untouched.

BindableProperties_MatchOptionsProperties only asserted one direction: every bindable option
is 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.FlushBeforeRequestCompleted
is internal and is a legitimate binding target.

Note for review

Not fixed here, but worth flagging: in BindableSentryOptions.NativeOptions.ApplyTo (Android),
ExperimentalOptions.SessionReplay.RedactAllText / RedactAllImages are assigned from the
options object rather than to it, so those two config keys are also discarded. They're
non-nullable bool, so unlike EnableTracing the fix isn't a deletion — applying them changes
behaviour 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

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>
@jamescrosswell jamescrosswell added the skip-changelog Suppress automatic changelog generation via Craft label Sep 21, 2026
@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.85%. Comparing base (3a9c2f1) to head (1c3b5d0).

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.
📢 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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Totally fair, and the tests actually don't look bad! 🙂
also thanks for the blog link!

@jamescrosswell
jamescrosswell marked this pull request as ready for review September 22, 2026 00:08
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Sep 22, 2026

@ric-oliv ric-oliv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

@jamescrosswell
jamescrosswell merged commit a3f9955 into main Sep 22, 2026
53 checks passed
@jamescrosswell
jamescrosswell deleted the chore/remove-dead-bindable-props branch September 22, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium skip-changelog Suppress automatic changelog generation via Craft

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants