-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
ref(analytics): Transform analytics events for TET-826 #95206
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-826
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: API Event Attributes Mismatch Integer IDs
The organization_id
, project_id
, and user_id
(where applicable) attributes in the PreprodArtifactApi
event classes are incorrectly typed as str
. These attributes receive integer Django model IDs (e.g., project.organization_id
, project.id
, request.user.id
), causing type checking errors and potential runtime issues.
src/sentry/preprod/analytics.py#L5-L20
sentry/src/sentry/preprod/analytics.py
Lines 5 to 20 in 8bf0573
class PreprodArtifactApiAssembleEvent(analytics.Event): | |
organization_id: str | |
project_id: str | |
user_id: str | None = None | |
@analytics.eventclass("preprod_artifact.api.update") | |
class PreprodArtifactApiUpdateEvent(analytics.Event): | |
organization_id: str | |
project_id: str | |
@analytics.eventclass("preprod_artifact.api.assemble_generic") | |
class PreprodArtifactApiAssembleGenericEvent(analytics.Event): | |
organization_id: str | |
project_id: str |
Was this report helpful? Give feedback by reacting with 👍 or 👎
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Closes TET-826