Browse Source

ref(sentry_apps): Move SentryAppInstallation model to sentry_apps (#77649)

Christinarlong 5 months ago
parent
commit
652f6c0689

+ 0 - 1
pyproject.toml

@@ -296,7 +296,6 @@ module = [
     "sentry.middleware.auth",
     "sentry.middleware.ratelimit",
     "sentry.middleware.superuser",
-    "sentry.models.integrations.sentry_app_installation",
     "sentry.models.organizationaccessrequest",
     "sentry.monitors.consumers.monitor_consumer",
     "sentry.monitors.endpoints.base",

+ 1 - 1
src/sentry/api/endpoints/integrations/sentry_apps/components.py

@@ -11,12 +11,12 @@ from sentry.api.paginator import OffsetPaginator
 from sentry.api.serializers import serialize
 from sentry.coreapi import APIError
 from sentry.models.integrations.sentry_app_component import SentryAppComponent
-from sentry.models.integrations.sentry_app_installation import SentryAppInstallation
 from sentry.organizations.services.organization.model import (
     RpcOrganization,
     RpcUserOrganizationContext,
 )
 from sentry.sentry_apps.components import SentryAppComponentPreparer
+from sentry.sentry_apps.models.sentry_app_installation import SentryAppInstallation
 
 
 # TODO(mgaeta): These endpoints are doing the same thing, but one takes a

+ 1 - 1
src/sentry/api/endpoints/integrations/sentry_apps/details.py

@@ -21,10 +21,10 @@ from sentry.api.serializers.rest_framework import SentryAppSerializer
 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.models.integrations.sentry_app_installation import SentryAppInstallation
 from sentry.organizations.services.organization import organization_service
 from sentry.sentry_apps.logic import SentryAppUpdater
 from sentry.sentry_apps.models.sentry_app import SentryApp
+from sentry.sentry_apps.models.sentry_app_installation import SentryAppInstallation
 from sentry.utils.audit import create_audit_entry
 
 logger = logging.getLogger(__name__)

+ 1 - 1
src/sentry/api/endpoints/integrations/sentry_apps/installation/details.py

@@ -13,7 +13,7 @@ from sentry.api.serializers import serialize
 from sentry.api.serializers.rest_framework import SentryAppInstallationSerializer
 from sentry.mediators.sentry_app_installations.installation_notifier import InstallationNotifier
 from sentry.mediators.sentry_app_installations.updater import Updater
-from sentry.models.integrations.sentry_app_installation import SentryAppInstallation
+from sentry.sentry_apps.models.sentry_app_installation import SentryAppInstallation
 from sentry.utils.audit import create_audit_entry
 
 

+ 1 - 1
src/sentry/api/endpoints/integrations/sentry_apps/installation/index.py

@@ -14,9 +14,9 @@ from sentry.auth.superuser import superuser_has_permission
 from sentry.constants import SENTRY_APP_SLUG_MAX_LENGTH, SentryAppStatus
 from sentry.features.exceptions import FeatureNotRegistered
 from sentry.integrations.models.integration_feature import IntegrationFeature, IntegrationTypes
-from sentry.models.integrations.sentry_app_installation import SentryAppInstallation
 from sentry.sentry_apps.installations import SentryAppInstallationCreator
 from sentry.sentry_apps.models.sentry_app import SentryApp
+from sentry.sentry_apps.models.sentry_app_installation import SentryAppInstallation
 
 
 class SentryAppInstallationsSerializer(serializers.Serializer):

+ 1 - 1
src/sentry/api/endpoints/integrations/sentry_apps/internal_app_token/index.py

@@ -13,9 +13,9 @@ from sentry.api.endpoints.integrations.sentry_apps.details import (
 from sentry.api.serializers.models.apitoken import ApiTokenSerializer
 from sentry.exceptions import ApiTokenLimitError
 from sentry.models.apitoken import ApiToken
-from sentry.models.integrations.sentry_app_installation import SentryAppInstallation
 from sentry.sentry_apps.installations import SentryAppInstallationTokenCreator
 from sentry.sentry_apps.models.sentry_app import MASKED_VALUE
+from sentry.sentry_apps.models.sentry_app_installation import SentryAppInstallation
 
 
 @control_silo_endpoint

+ 1 - 1
src/sentry/api/endpoints/integrations/sentry_apps/stats/details.py

@@ -5,7 +5,7 @@ from sentry import tsdb
 from sentry.api.api_publish_status import ApiPublishStatus
 from sentry.api.base import StatsMixin, control_silo_endpoint
 from sentry.api.bases import SentryAppBaseEndpoint, SentryAppStatsPermission
-from sentry.models.integrations.sentry_app_installation import SentryAppInstallation
+from sentry.sentry_apps.models.sentry_app_installation import SentryAppInstallation
 
 
 @control_silo_endpoint

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

@@ -12,10 +12,10 @@ from sentry.api.serializers import ProjectWithOrganizationSerializer, serialize
 from sentry.auth.superuser import is_active_superuser
 from sentry.constants import ObjectStatus
 from sentry.db.models.query import in_iexact
-from sentry.models.integrations.sentry_app_installation import SentryAppInstallation
 from sentry.models.project import Project
 from sentry.models.projectplatform import ProjectPlatform
 from sentry.search.utils import tokenize_query
+from sentry.sentry_apps.models.sentry_app_installation import SentryAppInstallation
 
 
 @region_silo_endpoint

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

@@ -7,10 +7,10 @@ from rest_framework import serializers
 from sentry.api.serializers import Serializer, register
 from sentry.constants import ObjectStatus
 from sentry.models.environment import Environment
-from sentry.models.integrations.sentry_app_installation import prepare_ui_component
 from sentry.models.rule import NeglectedRule, Rule, RuleActivity, RuleActivityType
 from sentry.models.rulefirehistory import RuleFireHistory
 from sentry.models.rulesnooze import RuleSnooze
+from sentry.sentry_apps.models.sentry_app_installation import prepare_ui_component
 from sentry.sentry_apps.services.app.model import RpcSentryAppComponentContext
 from sentry.users.services.user.service import user_service
 

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

@@ -6,8 +6,8 @@ from typing import Any
 from sentry.api.serializers import Serializer, register
 from sentry.constants import SentryAppInstallationStatus
 from sentry.hybridcloud.services.organization_mapping import organization_mapping_service
-from sentry.models.integrations.sentry_app_installation import SentryAppInstallation
 from sentry.sentry_apps.models.sentry_app import SentryApp
+from sentry.sentry_apps.models.sentry_app_installation import SentryAppInstallation
 from sentry.users.models.user import User
 from sentry.users.services.user import RpcUser
 

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