-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
chore(sentry_apps): Move Sentry App serializers to sentry_apps! #77995
chore(sentry_apps): Move Sentry App serializers to sentry_apps! #77995
Conversation
❌ 10 Tests Failed:
View the top 3 failed tests by shortest run time
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
from sentry.models.avatars.sentry_app_avatar import SentryAppAvatar | ||
from sentry.sentry_apps.api.serializers.sentry_app_requests import SentryAppAvatarSerializer |
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.
I think it is a good idea to distinguish request and response serializers. Should we have a separate module for request serializers instead of a module suffix? Perhaps something like sentry.sentry_apps.api.parsers
for the request parsing serializers?
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.
that's a good idea. Prob should move the avatar request serializer into its own file while there 🫠
@@ -17,7 +17,9 @@ class RequestSerializer(Serializer): | |||
def __init__(self, sentry_app: SentryApp) -> None: | |||
self.sentry_app = sentry_app | |||
|
|||
def get_attrs(self, item_list: list[Any], user: Any, **kwargs: Any) -> MutableMapping[Any, Any]: | |||
def get_attrs( |
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.
Neat, we had a response serializer in the rest_framework serializer directory 🫠
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.
:bufo-melting:
from sentry.mediators.sentry_app_installations.installation_notifier import InstallationNotifier | ||
from sentry.mediators.sentry_app_installations.updater import Updater | ||
from sentry.sentry_apps.api.serializers.parsers.sentry_app_installation import ( |
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.
Should we have sentry.sentry_apps.api.parsers
instead?
from sentry.auth.staff import is_active_staff | ||
from sentry.constants import SentryAppStatus | ||
from sentry.mediators.sentry_app_installations.installation_notifier import InstallationNotifier | ||
from sentry.organizations.services.organization import organization_service | ||
from sentry.sentry_apps.api.serializers.parsers.sentry_app import RequestSentryAppSerializer |
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.
SentryAppParser would be a nice classname to have. Would mirror the Serializer conventions without overlapping terms.
migrate all sentry app related serializers to sentry_apps!
[X] serializers
[X] tests
[x] typing
[] getsentry shim - None so far
issue ref(#73857)