From 583d15d6c3f7851dcfc84be8a5839f223deafca6 Mon Sep 17 00:00:00 2001 From: Gabe Villalobos Date: Fri, 27 Oct 2023 09:40:20 -0700 Subject: [PATCH] ref(hybrid-cloud): Removes all region organization provisioning paths (#58878) --- src/sentry/backup/imports.py | 4 +- src/sentry/options/defaults.py | 3 - src/sentry/receivers/core.py | 16 +-- .../hybrid_cloud/organization_actions/impl.py | 34 ----- .../hybrid_cloud/organization_mapping/impl.py | 20 +-- .../organization_provisioning/__init__.py | 1 - .../organization_provisioning/impl.py | 119 ------------------ .../organization_provisioning/service.py | 62 --------- .../services/organization/provisioning.py | 56 +-------- .../test_control_organization_provisioning.py | 5 - .../test_region_organization_provisioning.py | 7 -- .../hybrid_cloud/test_organizationmapping.py | 68 +--------- .../services/test_organization_actions.py | 22 ---- 13 files changed, 19 insertions(+), 398 deletions(-) delete mode 100644 src/sentry/services/hybrid_cloud/organization_provisioning/__init__.py delete mode 100644 src/sentry/services/hybrid_cloud/organization_provisioning/impl.py delete mode 100644 src/sentry/services/hybrid_cloud/organization_provisioning/service.py diff --git a/src/sentry/backup/imports.py b/src/sentry/backup/imports.py index 23a50bda74622a..fed9199f2aa5fe 100644 --- a/src/sentry/backup/imports.py +++ b/src/sentry/backup/imports.py @@ -25,7 +25,6 @@ RpcPrimaryKeyMap, ) from sentry.services.hybrid_cloud.import_export.service import ImportExportService -from sentry.services.organization import should_use_control_provisioning from sentry.silo.base import SiloMode from sentry.silo.safety import unguarded_write from sentry.utils import json @@ -261,8 +260,7 @@ def resolve_org_slugs_from_pk_map(pk_map: PrimaryKeyMap): else: do_writes(pk_map) - if should_use_control_provisioning(): - resolve_org_slugs_from_pk_map(pk_map) + resolve_org_slugs_from_pk_map(pk_map) if deferred_org_auth_tokens: do_write(pk_map, org_auth_token_model_name, deferred_org_auth_tokens) diff --git a/src/sentry/options/defaults.py b/src/sentry/options/defaults.py index 2b41e2ac1a3a0f..7f5ca1cd633d24 100644 --- a/src/sentry/options/defaults.py +++ b/src/sentry/options/defaults.py @@ -1492,9 +1492,6 @@ ) register("hybrid_cloud.outbox_rate", default=0.0, flags=FLAG_AUTOMATOR_MODIFIABLE) -register( - "hybrid_cloud.control-organization-provisioning", default=False, flags=FLAG_AUTOMATOR_MODIFIABLE -) # Decides whether an incoming transaction triggers an update of the clustering rule applied to it. register("txnames.bump-lifetime-sample-rate", default=0.1, flags=FLAG_AUTOMATOR_MODIFIABLE) diff --git a/src/sentry/receivers/core.py b/src/sentry/receivers/core.py index 7e6797c5b42bd2..ca98a1ae769c6f 100644 --- a/src/sentry/receivers/core.py +++ b/src/sentry/receivers/core.py @@ -19,10 +19,7 @@ from sentry.models.team import Team from sentry.services.hybrid_cloud.user.service import user_service from sentry.services.hybrid_cloud.util import region_silo_function -from sentry.services.organization import ( - organization_provisioning_service, - should_use_control_provisioning, -) +from sentry.services.organization import organization_provisioning_service from sentry.signals import post_upgrade, project_created from sentry.silo import SiloMode from sentry.utils.env import in_test_environment @@ -110,12 +107,11 @@ def create_default_project(id, name, slug, verbosity=2, **kwargs): cursor = connection.cursor() cursor.execute(PROJECT_SEQUENCE_FIX) - if should_use_control_provisioning(): - # We need to provision an organization slug in control silo, so we do - # this by "changing" the slug, then re-replicating the org data. - organization_provisioning_service.change_organization_slug( - organization_id=org.id, slug="sentry" - ) + # We need to provision an organization slug in control silo, so we do + # this by "changing" the slug, then re-replicating the org data. + organization_provisioning_service.change_organization_slug( + organization_id=org.id, slug="sentry" + ) org.handle_async_replication(org.id) diff --git a/src/sentry/services/hybrid_cloud/organization_actions/impl.py b/src/sentry/services/hybrid_cloud/organization_actions/impl.py index f376f4b66fd99d..d81a47a13b8284 100644 --- a/src/sentry/services/hybrid_cloud/organization_actions/impl.py +++ b/src/sentry/services/hybrid_cloud/organization_actions/impl.py @@ -7,14 +7,8 @@ from django.utils.text import slugify from typing_extensions import TypedDict -from sentry import roles from sentry.models.organization import Organization, OrganizationStatus -from sentry.models.organizationmember import OrganizationMember -from sentry.models.organizationmemberteam import OrganizationMemberTeam from sentry.models.outbox import outbox_context -from sentry.services.hybrid_cloud.organization_actions.model import ( - OrganizationAndMemberCreationResult, -) class OrganizationCreateAndUpdateOptions(TypedDict, total=False): @@ -25,34 +19,6 @@ class OrganizationCreateAndUpdateOptions(TypedDict, total=False): default_role: int -def create_organization_with_outbox_message( - *, create_options: OrganizationCreateAndUpdateOptions -) -> Organization: - org: Organization = Organization.objects.create(**create_options) - return org - - -def create_organization_and_member_for_monolith( - organization_name: str, - user_id: int, - slug: str, - create_default_team: bool, - is_test: bool = False, -) -> OrganizationAndMemberCreationResult: - org = Organization.objects.create(name=organization_name, slug=slug, is_test=is_test) - - om = OrganizationMember.objects.create( - user_id=user_id, organization=org, role=roles.get_top_dog().id - ) - - team = None - if create_default_team: - team = org.team_set.create(name=org.name) - OrganizationMemberTeam.objects.create(team=team, organizationmember=om, is_active=True) - - return OrganizationAndMemberCreationResult(organization=org, org_member=om, team=team) - - def update_organization_with_outbox_message( *, org_id: int, update_data: OrganizationCreateAndUpdateOptions ) -> Organization: diff --git a/src/sentry/services/hybrid_cloud/organization_mapping/impl.py b/src/sentry/services/hybrid_cloud/organization_mapping/impl.py index e6e1881a8cb153..c1e7e45ff435f9 100644 --- a/src/sentry/services/hybrid_cloud/organization_mapping/impl.py +++ b/src/sentry/services/hybrid_cloud/organization_mapping/impl.py @@ -11,7 +11,6 @@ RpcOrganizationMappingUpdate, ) from sentry.services.hybrid_cloud.organization_mapping.serial import serialize_organization_mapping -from sentry.services.organization import should_use_control_provisioning from sentry.silo import unguarded_write @@ -120,24 +119,15 @@ def upsert(self, organization_id: int, update: RpcOrganizationMappingUpdate) -> update_dict["customer_id"] = update.customer_id[0] with unguarded_write(using=router.db_for_write(OrganizationMapping)): - use_control_provisioning = should_use_control_provisioning() - if use_control_provisioning: - mapping_is_valid = self._check_organization_mapping_integrity( - org_id=organization_id, update=update - ) - if not mapping_is_valid: - return + mapping_is_valid = self._check_organization_mapping_integrity( + org_id=organization_id, update=update + ) + if not mapping_is_valid: + return OrganizationMapping.objects.update_or_create( organization_id=organization_id, defaults=update_dict ) - if not use_control_provisioning: - # If control provisioning is disabled, we have to manually write a slug - # reservation for the organization. - self._upsert_organization_slug_reservation_for_monolith( - organization_id=organization_id, mapping_update=update - ) - def delete(self, organization_id: int) -> None: OrganizationMapping.objects.filter(organization_id=organization_id).delete() diff --git a/src/sentry/services/hybrid_cloud/organization_provisioning/__init__.py b/src/sentry/services/hybrid_cloud/organization_provisioning/__init__.py deleted file mode 100644 index 8404f443605b9c..00000000000000 --- a/src/sentry/services/hybrid_cloud/organization_provisioning/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .service import * # noqa diff --git a/src/sentry/services/hybrid_cloud/organization_provisioning/impl.py b/src/sentry/services/hybrid_cloud/organization_provisioning/impl.py deleted file mode 100644 index 19b8f4690c0247..00000000000000 --- a/src/sentry/services/hybrid_cloud/organization_provisioning/impl.py +++ /dev/null @@ -1,119 +0,0 @@ -from typing import Optional - -from django.db import IntegrityError, router, transaction -from sentry_sdk import capture_exception - -from sentry import roles -from sentry.models.organization import Organization -from sentry.models.organizationmember import OrganizationMember -from sentry.models.outbox import OutboxCategory, OutboxScope, RegionOutbox, outbox_context -from sentry.services.hybrid_cloud.organization import RpcOrganization -from sentry.services.hybrid_cloud.organization.serial import serialize_rpc_organization -from sentry.services.hybrid_cloud.organization_actions.impl import ( - create_organization_and_member_for_monolith, -) -from sentry.services.hybrid_cloud.organization_provisioning import OrganizationProvisioningService -from sentry.services.organization import OrganizationProvisioningOptions - - -class SlugMismatchException(Exception): - pass - - -def create_post_provision_outbox( - provisioning_options: OrganizationProvisioningOptions, org_id: int -): - return RegionOutbox( - shard_scope=OutboxScope.ORGANIZATION_SCOPE, - shard_identifier=org_id, - category=OutboxCategory.POST_ORGANIZATION_PROVISION, - object_identifier=org_id, - payload=provisioning_options.post_provision_options.json(), - ) - - -class InvalidOrganizationProvisioningSlugQueryException(Exception): - pass - - -class DatabaseBackedOrganizationProvisioningService(OrganizationProvisioningService): - def _validate_organization_belongs_to_user( - self, user_id: int, organization: RpcOrganization - ) -> bool: - top_dog_id = roles.get_top_dog().id - try: - org_member = OrganizationMember.objects.get( - organization_id=organization.id, user_id=user_id - ) - return top_dog_id == org_member.role - except OrganizationMember.DoesNotExist: - return False - - def provision_organization( - self, *, region_name: str, org_provision_args: OrganizationProvisioningOptions - ) -> RpcOrganization: - provision_options = org_provision_args.provision_options - with outbox_context(transaction.atomic(router.db_for_write(Organization))): - org_creation_result = create_organization_and_member_for_monolith( - user_id=provision_options.owning_user_id, - slug=provision_options.slug, - organization_name=provision_options.name, - create_default_team=provision_options.create_default_team, - is_test=provision_options.is_test, - ) - - org = org_creation_result.organization - create_post_provision_outbox( - provisioning_options=org_provision_args, org_id=org.id - ).save() - - return serialize_rpc_organization(org) - - def idempotent_provision_organization( - self, *, region_name: str, org_provision_args: OrganizationProvisioningOptions - ) -> Optional[RpcOrganization]: - sentry_org_options = org_provision_args.provision_options - try: - assert ( - org_provision_args.provision_options.owning_user_id - ), "An owning user ID must be provided when provisioning an idempotent organization" - - with outbox_context(transaction.atomic(router.db_for_write(Organization))): - org = self.provision_organization( - region_name=region_name, org_provision_args=org_provision_args - ) - - if org.slug != sentry_org_options.slug: - raise SlugMismatchException( - f"Expected slug to be {sentry_org_options.slug}, received {org.slug}" - ) - - return org - except (IntegrityError, SlugMismatchException): - # We've collided with another organization slug and can't fully - # provision the org, so we rollback the insert and validate - # whether the provided user ID owns the existing organization. - existing_organization = Organization.objects.filter( - slug=org_provision_args.provision_options.slug - ) - - if existing_organization.count() == 1 and self._validate_organization_belongs_to_user( - user_id=sentry_org_options.owning_user_id, organization=existing_organization[0] - ): - return serialize_rpc_organization(existing_organization[0]) - - if existing_organization.count() > 1: - capture_exception( - InvalidOrganizationProvisioningSlugQueryException( - f"Too many organizations ({existing_organization.count()})" - + " were returned when checking for idempotency" - ) - ) - else: - capture_exception( - InvalidOrganizationProvisioningSlugQueryException( - "No organization was found when validating an organization collision" - + f" for slug '{org_provision_args.provision_options.slug}'" - ) - ) - return None diff --git a/src/sentry/services/hybrid_cloud/organization_provisioning/service.py b/src/sentry/services/hybrid_cloud/organization_provisioning/service.py deleted file mode 100644 index ff644f107218cc..00000000000000 --- a/src/sentry/services/hybrid_cloud/organization_provisioning/service.py +++ /dev/null @@ -1,62 +0,0 @@ -# Please do not use -# from __future__ import annotations -# in modules such as this one where hybrid cloud data models or service classes are -# defined, because we want to reflect on type annotations and avoid forward references. -from abc import abstractmethod -from typing import Optional - -from sentry.services.hybrid_cloud.organization import RpcOrganization -from sentry.services.hybrid_cloud.region import ByRegionName -from sentry.services.hybrid_cloud.rpc import RpcService, regional_rpc_method -from sentry.services.organization.model import OrganizationProvisioningOptions -from sentry.silo import SiloMode - - -class OrganizationProvisioningService(RpcService): - key = "organization_provisioning" - local_mode = SiloMode.REGION - - @regional_rpc_method(resolve=ByRegionName()) - @abstractmethod - def provision_organization( - self, *, region_name: str, org_provision_args: OrganizationProvisioningOptions - ) -> RpcOrganization: - """ - Provisions an organization, an organization member, and team based on the provisioning args passed. - - In the event of a slug conflict, a new slug will be generated using the provided slug as a seed. - :param region_name: The region to provision the organization in. - :param org_provision_args: Provisioning and post-provisioning options for the organization. - :return: RpcOrganization containing a subset of the organization data. - """ - pass - - @regional_rpc_method(resolve=ByRegionName()) - @abstractmethod - def idempotent_provision_organization( - self, *, region_name: str, org_provision_args: OrganizationProvisioningOptions - ) -> Optional[RpcOrganization]: - """ - Provisions an organization, an organization member, and team based on the provisioning args passed. - - In the event of a slug conflict, the conflicting org will be queried. If the provided owning_user_id - matches the organization's owning user, the organization will be returned. Otherwise, None will be returned. - - Note: This is not intended to be used for normal organization provisioning; but rather, for use-cases - such as integrations which require strong idempotency. - :param region_name: The region to provision the organization in. - :param org_provision_args: Provisioning and post-provisioning options for the organization. - :return: RpcOrganization containing a subset of the organization data. - """ - pass - - @classmethod - def get_local_implementation(cls) -> RpcService: - from sentry.services.hybrid_cloud.organization_provisioning.impl import ( - DatabaseBackedOrganizationProvisioningService, - ) - - return DatabaseBackedOrganizationProvisioningService() - - -organization_provisioning_service = OrganizationProvisioningService.create_delegation() diff --git a/src/sentry/services/organization/provisioning.py b/src/sentry/services/organization/provisioning.py index 2d8e8b8674640a..7cb245c64abfd6 100644 --- a/src/sentry/services/organization/provisioning.py +++ b/src/sentry/services/organization/provisioning.py @@ -1,15 +1,13 @@ from typing import Any, Optional, Set, Tuple -from django.db import IntegrityError, router, transaction +from django.db import router, transaction from django.dispatch import receiver from pydantic import ValidationError from sentry_sdk import capture_exception -from sentry import options from sentry.hybridcloud.rpc_services.region_organization_provisioning import ( region_organization_provisioning_rpc_service, ) -from sentry.models.organization import Organization from sentry.models.organizationslugreservation import ( OrganizationSlugReservation, OrganizationSlugReservationType, @@ -29,10 +27,6 @@ class OrganizationProvisioningException(Exception): pass -def should_use_control_provisioning() -> bool: - return options.get("hybrid_cloud.control-organization-provisioning") - - class OrganizationProvisioningService: def _validate_or_default_region(self, region_name: Optional[str]): silo_mode = SiloMode.get_current_mode() @@ -91,17 +85,8 @@ def provision_organization_in_region( """ destination_region_name = self._validate_or_default_region(region_name=region_name) - if should_use_control_provisioning(): - return self._control_based_provisioning( - provisioning_options=provisioning_options, region_name=destination_region_name - ) - - from sentry.services.hybrid_cloud.organization_provisioning import ( - organization_provisioning_service as rpc_org_provisioning_service, - ) - - return rpc_org_provisioning_service.provision_organization( - region_name=destination_region_name, org_provision_args=provisioning_options + return self._control_based_provisioning( + provisioning_options=provisioning_options, region_name=destination_region_name ) def idempotent_provision_organization_in_region( @@ -149,25 +134,9 @@ def change_organization_slug( :return: """ - if should_use_control_provisioning(): - return self._control_based_slug_change( - organization_id=organization_id, slug=slug, region_name=region_name - ) - - # Default local monolith implementation - try: - with transaction.atomic(using=router.db_for_write(Organization)): - organization = Organization.objects.get(id=organization_id) - organization.slug = slug - organization.save() - - from sentry.services.hybrid_cloud.organization.serial import ( - serialize_rpc_organization, - ) - - return serialize_rpc_organization(org=organization) - except IntegrityError: - raise OrganizationSlugCollisionException() + return self._control_based_slug_change( + organization_id=organization_id, slug=slug, region_name=region_name + ) def bulk_create_organization_slugs( self, org_ids_and_slugs: Set[Tuple[int, str]], region_name: Optional[str] = None @@ -188,9 +157,6 @@ def bulk_create_organization_slugs( :param region_name: The region where the imported organizations exist :return: """ - if not should_use_control_provisioning(): - raise Exception("Cannot bulk create slugs with control provisioning disabled") - destination_region_name = self._validate_or_default_region(region_name=region_name) from sentry.hybridcloud.rpc_services.control_organization_provisioning import ( @@ -257,11 +223,6 @@ def handle_organization_provisioning_outbox_payload( def process_provision_organization_outbox( object_identifier: int, region_name: str, payload: Any, **kwds: Any ): - if not should_use_control_provisioning(): - raise Exception( - "Outbox handler should not be triggered while control provisioning disabled" - ) - try: provision_payload = OrganizationProvisioningOptions.parse_obj(payload) except ValidationError as e: @@ -295,11 +256,6 @@ def handle_possible_organization_slug_swap(*, region_name: str, org_slug_reserva if not org_slug_reservation_qs.exists(): return - if not should_use_control_provisioning(): - raise Exception( - "Outbox handler should not be triggered while control provisioning disabled" - ) - org_slug_reservation = org_slug_reservation_qs.first() from sentry.hybridcloud.rpc_services.control_organization_provisioning import ( diff --git a/tests/sentry/hybrid_cloud/rpc_services/test_control_organization_provisioning.py b/tests/sentry/hybrid_cloud/rpc_services/test_control_organization_provisioning.py index cfa3607deeca42..63d38cbd48e102 100644 --- a/tests/sentry/hybrid_cloud/rpc_services/test_control_organization_provisioning.py +++ b/tests/sentry/hybrid_cloud/rpc_services/test_control_organization_provisioning.py @@ -32,11 +32,6 @@ class TestControlOrganizationProvisioningBase(TestCase): - @pytest.fixture(autouse=True) - def _enable_control_provisioning_option(self): - with override_options({"hybrid_cloud.control-organization-provisioning": True}): - yield - def setUp(self): self.provision_user = self.create_user() self.provisioning_args = self.generate_provisioning_args( diff --git a/tests/sentry/hybrid_cloud/rpc_services/test_region_organization_provisioning.py b/tests/sentry/hybrid_cloud/rpc_services/test_region_organization_provisioning.py index 8e7715f537f12e..2637626b7ab6a6 100644 --- a/tests/sentry/hybrid_cloud/rpc_services/test_region_organization_provisioning.py +++ b/tests/sentry/hybrid_cloud/rpc_services/test_region_organization_provisioning.py @@ -1,4 +1,3 @@ -import pytest from django.db import router, transaction from sentry.hybridcloud.rpc_services.control_organization_provisioning import ( @@ -24,7 +23,6 @@ ) from sentry.silo import SiloMode from sentry.testutils.cases import TestCase -from sentry.testutils.helpers import override_options from sentry.testutils.silo import assume_test_silo_mode, control_silo_test @@ -199,11 +197,6 @@ def test_does_not_provision_when_organization_slug_already_in_use( @control_silo_test(stable=True) class TestRegionOrganizationProvisioningUpdateOrganizationSlug(TestCase): - @pytest.fixture(autouse=True) - def _enable_control_provisioning_option(self): - with override_options({"hybrid_cloud.control-organization-provisioning": True}): - yield - def setUp(self): self.provisioning_user = self.create_user() self.provisioned_org = self.create_organization( diff --git a/tests/sentry/hybrid_cloud/test_organizationmapping.py b/tests/sentry/hybrid_cloud/test_organizationmapping.py index 2e0c6fd615462c..8f089aa99af91b 100644 --- a/tests/sentry/hybrid_cloud/test_organizationmapping.py +++ b/tests/sentry/hybrid_cloud/test_organizationmapping.py @@ -1,7 +1,6 @@ from typing import Optional -import pytest -from django.db import IntegrityError, router, transaction +from django.db import router, transaction from sentry.models.organization import Organization, OrganizationStatus from sentry.models.organizationmapping import OrganizationMapping @@ -19,7 +18,6 @@ ) from sentry.silo import SiloMode from sentry.testutils.cases import TransactionTestCase -from sentry.testutils.helpers import override_options from sentry.testutils.silo import assume_test_silo_mode, control_silo_test, region_silo_test from sentry.types.region import get_local_region @@ -47,72 +45,8 @@ def assert_matching_organization_mapping( assert org_mapping.codecov_access == bool(org.flags.codecov_access) -@control_silo_test(stable=True) -class OrganizationMappingServiceControlProvisioningDisabledTest(TransactionTestCase): - def test_upsert__create_if_not_found(self): - self.organization = self.create_organization(name="test name", slug="foobar", region="us") - - fixture_org_mapping = OrganizationMapping.objects.get(organization_id=self.organization.id) - fixture_org_mapping.delete() - - assert not OrganizationMapping.objects.filter(organization_id=self.organization.id).exists() - - organization_mapping_service.upsert( - organization_id=self.organization.id, - update=RpcOrganizationMappingUpdate( - name=self.organization.name, - slug=self.organization.slug, - status=self.organization.status, - region_name="us", - ), - ) - - assert_matching_organization_mapping(org=self.organization) - - def test_upsert__update_if_found(self): - with assume_test_silo_mode(SiloMode.REGION): - self.organization = self.create_organization( - name="test name", slug="santryslug", region="us" - ) - - fixture_org_mapping = OrganizationMapping.objects.get(organization_id=self.organization.id) - - organization_mapping_service.upsert( - organization_id=self.organization.id, - update=RpcOrganizationMappingUpdate( - name="santry_org", - slug="santryslug", - status=OrganizationStatus.PENDING_DELETION, - region_name="us", - ), - ) - - fixture_org_mapping.refresh_from_db() - assert fixture_org_mapping.name == "santry_org" - assert fixture_org_mapping.slug == self.organization.slug - assert fixture_org_mapping.status == OrganizationStatus.PENDING_DELETION - - def test_upsert__reject_duplicate_slug(self): - self.organization = self.create_organization(slug="alreadytaken", region="us") - - fake_org_id = 7654321 - with pytest.raises(IntegrityError): - organization_mapping_service.upsert( - organization_id=fake_org_id, - update=RpcOrganizationMappingUpdate(slug=self.organization.slug, region_name="us"), - ) - - assert_matching_organization_mapping(org=self.organization) - assert not OrganizationMapping.objects.filter(organization_id=fake_org_id).exists() - - @control_silo_test(stable=True) class OrganizationMappingServiceControlProvisioningEnabledTest(TransactionTestCase): - @pytest.fixture(autouse=True) - def _enable_provisioning_option(self): - with override_options({"hybrid_cloud.control-organization-provisioning": True}): - yield - def test_upsert__create_if_not_found(self): self.organization = self.create_organization(name="test name", slug="foobar", region="us") diff --git a/tests/sentry/services/test_organization_actions.py b/tests/sentry/services/test_organization_actions.py index c2e08c3fd261d4..a23a052f8bac01 100644 --- a/tests/sentry/services/test_organization_actions.py +++ b/tests/sentry/services/test_organization_actions.py @@ -5,7 +5,6 @@ from sentry.models.organization import Organization, OrganizationStatus from sentry.models.outbox import OutboxCategory, OutboxScope, RegionOutbox, outbox_context from sentry.services.hybrid_cloud.organization_actions.impl import ( - create_organization_with_outbox_message, generate_deterministic_organization_slug, mark_organization_as_pending_deletion_with_outbox_message, unmark_organization_as_pending_deletion_with_outbox_message, @@ -29,27 +28,6 @@ def assert_outbox_update_message_exists(org: Organization, expected_count: int): assert org_update_outbox.category == OutboxCategory.ORGANIZATION_UPDATE -@region_silo_test(stable=True) -class OrganizationUpdateTest(TestCase): - def setUp(self): - self.org: Organization = self.create_organization(slug="sluggy", name="barfoo") - - def test_create_organization_with_outbox_message(self): - with outbox_context(flush=False): - org: Organization = create_organization_with_outbox_message( - create_options={ - "slug": "santry", - "name": "santry", - "status": OrganizationStatus.ACTIVE, - } - ) - - assert org.id - assert org.slug == "santry" - assert org.name == "santry" - assert_outbox_update_message_exists(org=org, expected_count=1) - - @region_silo_test(stable=True) class OrganizationUpdateWithOutboxTest(TestCase): def setUp(self):