From 51d0f0517f258ec5152df20c322ccac2419eef02 Mon Sep 17 00:00:00 2001 From: Evan Purkhiser Date: Mon, 13 May 2024 14:32:41 -0400 Subject: [PATCH] re(crons): Consistent import of `.base` in endpoints (#70787) --- .../endpoints/monitor_ingest_checkin_attachment.py | 7 ++----- .../monitors/endpoints/organization_monitor_details.py | 5 +++-- .../endpoints/organization_monitor_environment_details.py | 7 +++---- src/sentry/monitors/endpoints/project_monitor_details.py | 5 +++-- .../endpoints/project_monitor_environment_details.py | 7 +++---- .../endpoints/project_monitor_processing_errors_index.py | 3 ++- .../endpoints/project_processing_errors_details.py | 3 ++- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/sentry/monitors/endpoints/monitor_ingest_checkin_attachment.py b/src/sentry/monitors/endpoints/monitor_ingest_checkin_attachment.py index 19fc7fc53e61c7..ceb89788a34490 100644 --- a/src/sentry/monitors/endpoints/monitor_ingest_checkin_attachment.py +++ b/src/sentry/monitors/endpoints/monitor_ingest_checkin_attachment.py @@ -24,14 +24,11 @@ from sentry.models.organization import Organization from sentry.models.project import Project from sentry.models.projectkey import ProjectKey -from sentry.monitors.endpoints.base import ( - ProjectMonitorPermission, - get_monitor_by_org_id_or_slug, - try_checkin_lookup, -) from sentry.monitors.models import Monitor, MonitorCheckIn from sentry.utils.sdk import bind_organization_context +from .base import ProjectMonitorPermission, get_monitor_by_org_id_or_slug, try_checkin_lookup + MAX_ATTACHMENT_SIZE = 1024 * 100 # 100kb diff --git a/src/sentry/monitors/endpoints/organization_monitor_details.py b/src/sentry/monitors/endpoints/organization_monitor_details.py index f26db8299041eb..05f8bf95376fca 100644 --- a/src/sentry/monitors/endpoints/organization_monitor_details.py +++ b/src/sentry/monitors/endpoints/organization_monitor_details.py @@ -15,12 +15,13 @@ RESPONSE_UNAUTHORIZED, ) from sentry.apidocs.parameters import GlobalParams, MonitorParams -from sentry.monitors.endpoints.base import MonitorEndpoint -from sentry.monitors.endpoints.base_monitor_details import MonitorDetailsMixin from sentry.monitors.serializers import MonitorSerializer from sentry.monitors.validators import MonitorValidator from sentry.utils.auth import AuthenticatedHttpRequest +from .base import MonitorEndpoint +from .base_monitor_details import MonitorDetailsMixin + @region_silo_endpoint @extend_schema(tags=["Crons"]) diff --git a/src/sentry/monitors/endpoints/organization_monitor_environment_details.py b/src/sentry/monitors/endpoints/organization_monitor_environment_details.py index 9c87b9294236d2..06037bde55ba16 100644 --- a/src/sentry/monitors/endpoints/organization_monitor_environment_details.py +++ b/src/sentry/monitors/endpoints/organization_monitor_environment_details.py @@ -15,12 +15,11 @@ RESPONSE_UNAUTHORIZED, ) from sentry.apidocs.parameters import GlobalParams, MonitorParams -from sentry.monitors.endpoints.base import MonitorEndpoint -from sentry.monitors.endpoints.base_monitor_environment_details import ( - MonitorEnvironmentDetailsMixin, -) from sentry.monitors.serializers import MonitorSerializer +from .base import MonitorEndpoint +from .base_monitor_environment_details import MonitorEnvironmentDetailsMixin + @region_silo_endpoint @extend_schema(tags=["Crons"]) diff --git a/src/sentry/monitors/endpoints/project_monitor_details.py b/src/sentry/monitors/endpoints/project_monitor_details.py index d4312e827b1059..639efbfae338bc 100644 --- a/src/sentry/monitors/endpoints/project_monitor_details.py +++ b/src/sentry/monitors/endpoints/project_monitor_details.py @@ -15,12 +15,13 @@ RESPONSE_UNAUTHORIZED, ) from sentry.apidocs.parameters import GlobalParams, MonitorParams -from sentry.monitors.endpoints.base import ProjectMonitorEndpoint -from sentry.monitors.endpoints.base_monitor_details import MonitorDetailsMixin from sentry.monitors.serializers import MonitorSerializer from sentry.monitors.validators import MonitorValidator from sentry.utils.auth import AuthenticatedHttpRequest +from .base import ProjectMonitorEndpoint +from .base_monitor_details import MonitorDetailsMixin + @region_silo_endpoint @extend_schema(tags=["Crons"]) diff --git a/src/sentry/monitors/endpoints/project_monitor_environment_details.py b/src/sentry/monitors/endpoints/project_monitor_environment_details.py index 0f050eed1d9f82..1ff7e28cb83de0 100644 --- a/src/sentry/monitors/endpoints/project_monitor_environment_details.py +++ b/src/sentry/monitors/endpoints/project_monitor_environment_details.py @@ -15,12 +15,11 @@ RESPONSE_UNAUTHORIZED, ) from sentry.apidocs.parameters import GlobalParams, MonitorParams -from sentry.monitors.endpoints.base import ProjectMonitorEnvironmentEndpoint -from sentry.monitors.endpoints.base_monitor_environment_details import ( - MonitorEnvironmentDetailsMixin, -) from sentry.monitors.serializers import MonitorSerializer +from .base import ProjectMonitorEnvironmentEndpoint +from .base_monitor_environment_details import MonitorEnvironmentDetailsMixin + @region_silo_endpoint @extend_schema(tags=["Crons"]) diff --git a/src/sentry/monitors/endpoints/project_monitor_processing_errors_index.py b/src/sentry/monitors/endpoints/project_monitor_processing_errors_index.py index eaadb96874455a..c7b516a0b37709 100644 --- a/src/sentry/monitors/endpoints/project_monitor_processing_errors_index.py +++ b/src/sentry/monitors/endpoints/project_monitor_processing_errors_index.py @@ -9,13 +9,14 @@ from sentry.apidocs.constants import RESPONSE_FORBIDDEN, RESPONSE_NOT_FOUND, RESPONSE_UNAUTHORIZED from sentry.apidocs.parameters import GlobalParams, MonitorParams from sentry.apidocs.utils import inline_sentry_response_serializer -from sentry.monitors.endpoints.base import ProjectMonitorEndpoint from sentry.monitors.processing_errors import ( CheckinProcessErrorsManager, CheckinProcessingErrorData, ) from sentry.utils.auth import AuthenticatedHttpRequest +from .base import ProjectMonitorEndpoint + @region_silo_endpoint @extend_schema(tags=["Crons"]) diff --git a/src/sentry/monitors/endpoints/project_processing_errors_details.py b/src/sentry/monitors/endpoints/project_processing_errors_details.py index 3a85add3a80eca..67169046a9b4a4 100644 --- a/src/sentry/monitors/endpoints/project_processing_errors_details.py +++ b/src/sentry/monitors/endpoints/project_processing_errors_details.py @@ -20,9 +20,10 @@ ) from sentry.apidocs.parameters import GlobalParams, MonitorParams from sentry.models.project import Project -from sentry.monitors.endpoints.base import ProjectMonitorPermission from sentry.monitors.processing_errors import CheckinProcessErrorsManager, InvalidProjectError +from .base import ProjectMonitorPermission + @region_silo_endpoint @extend_schema(tags=["Crons"])