Skip to content
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

Merged
merged 14 commits into from
Sep 27, 2024

Conversation

Christinarlong
Copy link
Contributor

@Christinarlong Christinarlong commented Sep 23, 2024

migrate all sentry app related serializers to sentry_apps!
[X] serializers
[X] tests
[x] typing
[] getsentry shim - None so far

issue ref(#73857)

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 23, 2024
Copy link

codecov bot commented Sep 23, 2024

❌ 10 Tests Failed:

Tests completed Failed Passed Skipped
112 10 102 1
View the top 3 failed tests by shortest run time
 tests.sentry.api.endpoints.test_system_options
Stack Traces | 0s run time
No failure message available
 tests.sentry.hybridcloud.apigateway.test_apigateway
Stack Traces | 0s run time
No failure message available
 tests.sentry.middleware.integrations.parsers.test_github_enterprise
Stack Traces | 0s run time
No failure message available

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
Copy link
Member

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?

Copy link
Contributor Author

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(
Copy link
Member

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 🫠

Copy link
Contributor Author

Choose a reason for hiding this comment

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

:bufo-melting:

@Christinarlong Christinarlong requested a review from a team as a code owner September 24, 2024 21:22
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 (
Copy link
Member

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
Copy link
Member

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.

@Christinarlong Christinarlong merged commit 05e20b6 into master Sep 27, 2024
49 checks passed
@Christinarlong Christinarlong deleted the christinarlong/move-sentryapps-serializers branch September 27, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants