Browse Source

chore(sentry_apps): Move validators for sentryapps to sentry_apps (#78281)

Christinarlong 5 months ago
parent
commit
a49edf8ae4

+ 1 - 1
src/sentry/api/endpoints/project_servicehook_details.py

@@ -10,8 +10,8 @@ from sentry.api.base import region_silo_endpoint
 from sentry.api.bases.project import ProjectEndpoint
 from sentry.api.exceptions import ResourceDoesNotExist
 from sentry.api.serializers import serialize
-from sentry.api.validators import ServiceHookValidator
 from sentry.constants import ObjectStatus
+from sentry.sentry_apps.api.parsers.servicehook import ServiceHookValidator
 from sentry.sentry_apps.api.serializers.servicehook import ServiceHookSerializer
 from sentry.sentry_apps.models.servicehook import ServiceHook
 

+ 1 - 1
src/sentry/api/endpoints/project_servicehooks.py

@@ -10,8 +10,8 @@ from sentry.api.api_publish_status import ApiPublishStatus
 from sentry.api.base import region_silo_endpoint
 from sentry.api.bases.project import ProjectEndpoint
 from sentry.api.serializers import serialize
-from sentry.api.validators import ServiceHookValidator
 from sentry.constants import ObjectStatus
+from sentry.sentry_apps.api.parsers.servicehook import ServiceHookValidator
 from sentry.sentry_apps.api.serializers.servicehook import ServiceHookSerializer
 from sentry.sentry_apps.models.servicehook import ServiceHook
 from sentry.sentry_apps.services.hook import hook_service

+ 0 - 1
src/sentry/api/validators/__init__.py

@@ -7,5 +7,4 @@ from .integrations import *  # noqa: F401,F403
 from .notifications import *  # noqa: F401,F403
 from .project import *  # noqa: F401,F403
 from .project_codeowners import *  # noqa: F401,F403
-from .servicehook import *  # noqa: F401,F403
 from .userrole import *  # noqa: F401,F403

+ 0 - 0
src/sentry/api/validators/sentry_apps/schema.py → src/sentry/sentry_apps/api/parsers/schema.py


+ 1 - 1
src/sentry/sentry_apps/api/parsers/sentry_app.py

@@ -3,9 +3,9 @@ from rest_framework import serializers
 from rest_framework.serializers import Serializer, ValidationError
 
 from sentry.api.serializers.rest_framework.base import camel_to_snake_case
-from sentry.api.validators.sentry_apps.schema import validate_ui_element_schema
 from sentry.integrations.models.integration_feature import Feature
 from sentry.models.apiscopes import ApiScopes
+from sentry.sentry_apps.api.parsers.schema import validate_ui_element_schema
 from sentry.sentry_apps.models.sentry_app import (
     REQUIRED_EVENT_PERMISSIONS,
     UUID_CHARS_IN_SLUG,

+ 0 - 0
src/sentry/api/validators/servicehook.py → src/sentry/sentry_apps/api/parsers/servicehook.py


+ 0 - 0
tests/sentry/api/validators/__init__.py


+ 0 - 0
tests/sentry/api/validators/sentry_apps/__init__.py


+ 0 - 0
src/sentry/api/validators/sentry_apps/__init__.py → tests/sentry/sentry_apps/api/parsers/__init__.py


+ 1 - 1
tests/sentry/api/validators/sentry_apps/test_alert_rule_action.py → tests/sentry/sentry_apps/api/parsers/test_alert_rule_action.py

@@ -4,7 +4,7 @@ import unittest
 from typing import Any
 
 from fixtures.schema_validation import invalid_schema
-from sentry.api.validators.sentry_apps.schema import validate_component
+from sentry.sentry_apps.api.parsers.schema import validate_component
 
 
 class TestAlertRuleActionSchemaValidation(unittest.TestCase):

Some files were not shown because too many files changed in this diff