-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(analytics): typesafe-event-record #92943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat(analytics): typesafe-event-record #92943
Conversation
Deprecate stringly typed analytics.record() in favor of version that uses Event objects. Migrating Event to dataclasses. For convenience introduce the 'eventclass' macro, which sets the 'type' and configures the dataclass underneath.
…omatic field type transformation
❌ 209 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
This reverts commit 7dbcea8.
…object to be passed to copy values from
|
||
@classmethod | ||
def from_instance(cls, instance: Any, **kwargs: Any) -> Event: | ||
@deprecated("This constructor function is discuraged, as it is not type-safe.") | ||
def from_instance(cls, instance: Any, **kwargs: Any) -> Self: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now we need to remove the deprecation, as this causes failures in tests
…with inheritors fields
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Closes https://linear.app/getsentry/issue/TET-472/analytics-refactor-analyticsrecord-to-be-type-safe
Closes https://linear.app/getsentry/issue/TET-471/analytics-refactor-analyticsevent-to-be-dataclass-based
Contributes to https://linear.app/getsentry/issue/TET-474/analytics-migrate-all-subclasses-of-analyticsevent
Contributes to https://linear.app/getsentry/issue/TET-473/analytics-update-callsites-of-analyticsrecord-in-both-sentry-and
Making
analytics.record
andanalytics.Event
typesaferDeprecate stringly typed
analytics.record()
in favor of version that usesanalytics.Event
objects.Migrating
analytics.Event
to dataclasses. For convenience introduce theanalytics.eventclass
decorator, which sets thetype
and applies thedataclass
decorator with common parameters underneath.Migrate all subclasses in Sentry to the new dataclass based scheme.