-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
ref(analytics): Transform analytics events for TET-828 #95208
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?
Conversation
- Transform event classes to use @analytics.eventclass decorator - Transform analytics.record calls to use event class instances - Update imports as needed Closes TET-828
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.
Bug: Missing Fields in OrganizationCreatedEvent
The OrganizationCreatedEvent
constructor is missing required fields (id
, name
, slug
). The previous analytics.record
call implicitly provided these from the org
object, but the new OrganizationCreatedEvent
class requires them explicitly. Only actor_id
is currently passed, leading to a runtime error or incomplete event data.
src/sentry/api/endpoints/organization_index.py#L281-L286
sentry/src/sentry/api/endpoints/organization_index.py
Lines 281 to 286 in 6f8fc9e
analytics.record( | |
OrganizationCreatedEvent( | |
actor_id=request.user.id if request.user.is_authenticated else None, | |
) | |
) |
Bug: Incorrect Type Casting in Analytics Events
Analytics event definitions incorrectly type group_id
, project_id
, and organization_id
as str
. These fields are integers when passed from Django models (e.g., group.id
, project.id
, project.organization_id
) in receivers/features.py
.
src/sentry/analytics/events/issue_unresolved.py#L8-L9
sentry/src/sentry/analytics/events/issue_unresolved.py
Lines 8 to 9 in 6f8fc9e
organization_id: int | |
group_id: str |
src/sentry/analytics/events/issue_priority.py#L5-L9
sentry/src/sentry/analytics/events/issue_priority.py
Lines 5 to 9 in 6f8fc9e
class IssuePriorityUpdatedEvent(analytics.Event): | |
group_id: str | |
new_priority: str | |
project_id: str | |
organization_id: str |
Was this report helpful? Give feedback by reacting with 👍 or 👎
❌ 44 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Closes TET-828