Browse Source

ref(messaging): Updated Integration Types Imports (#72262)

Final PR to update the rest of the integration imports in sentry over to
the new module that I created. I edit 1 `__init__.py` file, plan is to
clean it up completely in a followup pr.
Raj Joshi 9 months ago
parent
commit
686daa2ebe

+ 2 - 1
src/sentry/api/bases/external_actor.py

@@ -16,13 +16,14 @@ from sentry.api.validators.external_actor import (
     validate_integration_id,
 )
 from sentry.api.validators.integrations import validate_provider
+from sentry.integrations.types import ExternalProviders
+from sentry.integrations.utils.providers import get_provider_choices
 from sentry.models.integrations.external_actor import ExternalActor
 from sentry.models.organization import Organization
 from sentry.models.team import Team
 from sentry.services.hybrid_cloud.organization import organization_service
 from sentry.services.hybrid_cloud.user import RpcUser
 from sentry.services.hybrid_cloud.user.service import user_service
-from sentry.types.integrations import ExternalProviders, get_provider_choices
 
 AVAILABLE_PROVIDERS = {
     ExternalProviders.GITHUB,

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

@@ -10,12 +10,12 @@ from sentry.api.bases.user import UserEndpoint
 from sentry.api.exceptions import ParameterValidationError
 from sentry.api.serializers import serialize
 from sentry.api.validators.notifications import validate_type
+from sentry.integrations.types import PERSONAL_NOTIFICATION_PROVIDERS
 from sentry.models.notificationsettingprovider import NotificationSettingProvider
 from sentry.models.user import User
 from sentry.notifications.serializers import NotificationSettingsProviderSerializer
 from sentry.notifications.types import NotificationSettingsOptionEnum
 from sentry.notifications.validators import UserNotificationSettingsProvidersDetailsSerializer
-from sentry.types.integrations import PERSONAL_NOTIFICATION_PROVIDERS
 
 
 @control_silo_endpoint

+ 1 - 1
src/sentry/api/serializers/models/external_actor.py

@@ -2,9 +2,9 @@ from collections.abc import Mapping, MutableMapping
 from typing import Any, TypedDict
 
 from sentry.api.serializers import Serializer, register
+from sentry.integrations.utils.providers import get_provider_string
 from sentry.models.integrations.external_actor import ExternalActor
 from sentry.models.user import User
-from sentry.types.integrations import get_provider_string
 
 
 class ExternalActorResponseOptional(TypedDict, total=False):

+ 1 - 1
src/sentry/api/validators/external_actor.py

@@ -4,9 +4,9 @@ from rest_framework import serializers
 
 from sentry.api.exceptions import ParameterValidationError
 from sentry.api.validators.integrations import validate_provider
+from sentry.integrations.types import ExternalProviders
 from sentry.models.organization import Organization
 from sentry.services.hybrid_cloud.integration import integration_service
-from sentry.types.integrations import ExternalProviders
 
 EXTERNAL_ID_LENGTH_MIN = 1
 EXTERNAL_ID_LENGTH_MAX = 64

+ 2 - 1
src/sentry/api/validators/integrations.py

@@ -1,5 +1,6 @@
 from sentry.api.exceptions import ParameterValidationError
-from sentry.types.integrations import ExternalProviders, get_provider_enum
+from sentry.integrations.types import ExternalProviders
+from sentry.integrations.utils.providers import get_provider_enum
 
 
 def validate_provider(

+ 1 - 1
src/sentry/api/validators/project_codeowners.py

@@ -5,6 +5,7 @@ from typing import Any
 
 from django.db.models import Subquery
 
+from sentry.integrations.types import ExternalProviders
 from sentry.models.integrations.external_actor import ExternalActor
 from sentry.models.organizationmember import OrganizationMember
 from sentry.models.organizationmemberteam import OrganizationMemberTeam
@@ -12,7 +13,6 @@ from sentry.models.project import Project
 from sentry.models.team import Team
 from sentry.ownership.grammar import parse_code_owners
 from sentry.services.hybrid_cloud.user.service import user_service
-from sentry.types.integrations import ExternalProviders
 
 
 def validate_association_emails(

+ 1 - 1
src/sentry/digests/utils.py

@@ -9,6 +9,7 @@ from django.db.models import Q
 
 from sentry.digests import Digest, Record
 from sentry.eventstore.models import Event
+from sentry.integrations.types import ExternalProviders
 from sentry.models.group import Group
 from sentry.models.project import Project
 from sentry.models.projectownership import ProjectOwnership
@@ -17,7 +18,6 @@ from sentry.models.rulesnooze import RuleSnooze
 from sentry.notifications.types import ActionTargetType, FallthroughChoiceType
 from sentry.notifications.utils.participants import get_send_to
 from sentry.types.actor import Actor
-from sentry.types.integrations import ExternalProviders
 
 
 def get_digest_metadata(

+ 1 - 1
src/sentry/incidents/action_handlers.py

@@ -16,6 +16,7 @@ from sentry.constants import CRASH_RATE_ALERT_AGGREGATE_ALIAS
 from sentry.incidents.charts import build_metric_alert_chart
 from sentry.incidents.models.alert_rule import AlertRuleThresholdType, AlertRuleTriggerAction
 from sentry.incidents.models.incident import INCIDENT_STATUS, IncidentStatus, TriggerStatus
+from sentry.integrations.types import ExternalProviders
 from sentry.models.rulesnooze import RuleSnooze
 from sentry.models.user import User
 from sentry.notifications.types import NotificationSettingEnum
@@ -25,7 +26,6 @@ from sentry.services.hybrid_cloud.user.service import user_service
 from sentry.services.hybrid_cloud.user_option import RpcUserOption, user_option_service
 from sentry.snuba.metrics import format_mri_field, is_mri_field
 from sentry.types.actor import Actor, ActorType
-from sentry.types.integrations import ExternalProviders
 from sentry.utils.email import MessageBuilder, get_email_addresses
 
 

+ 1 - 1
src/sentry/integrations/discord/message_builder/issues.py

@@ -17,11 +17,11 @@ from sentry.integrations.message_builder import (
     get_color,
     get_title_link,
 )
+from sentry.integrations.types import ExternalProviders
 from sentry.models.group import Group, GroupStatus
 from sentry.models.project import Project
 from sentry.models.rule import Rule
 from sentry.notifications.notifications.base import ProjectNotification
-from sentry.types.integrations import ExternalProviders
 
 from ..message_builder.base.component import DiscordComponentCustomIds as CustomIds
 

+ 1 - 1
src/sentry/integrations/discord/views/link_identity.py

@@ -5,11 +5,11 @@ from django.utils.decorators import method_decorator
 from django.views.decorators.cache import never_cache
 
 from sentry import analytics
+from sentry.integrations.types import ExternalProviders
 from sentry.integrations.utils.identities import get_identity_or_404
 from sentry.models.identity import Identity
 from sentry.services.hybrid_cloud.integration.model import RpcIntegration
 from sentry.types.actor import ActorType
-from sentry.types.integrations import ExternalProviders
 from sentry.utils.http import absolute_uri
 from sentry.utils.signing import sign, unsign
 from sentry.web.frontend.base import BaseView, control_silo_view

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