Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/sentry/integrations/middleware/hybrid_cloud/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,14 @@ def get_responses_from_cell_silos(self, cells: list[Cell]) -> dict[str, CellResu

def get_response_from_webhookpayload(
self,
cells: list[Cell] | None = None, # TODO(cells): make required once getsentry is updated
cells: list[Cell],
identifier: int | str | None = None,
integration_id: int | None = None,
regions: list[Cell] | None = None, # TODO(cells): remove once getsentry is updated
) -> HttpResponseBase:
"""
Used to create webhookpayloads for provided cells to handle the webhooks asynchronously.
Responds to the webhook provider with a 202 Accepted status.
"""
cells = cells or regions or []
if len(cells) < 1:
return HttpResponse(status=status.HTTP_202_ACCEPTED)

Expand Down
4 changes: 0 additions & 4 deletions src/sentry/testutils/cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,3 @@ def override_cells(cells: Sequence[Cell], local_cell: Cell | None = None) -> Gen
"""
with get_test_env_directory().swap_state(cells, local_cell=local_cell):
yield


# TODO(cells): Remove alias once no longer used in getsentry
override_regions = override_cells
2 changes: 0 additions & 2 deletions src/sentry/testutils/region.py

This file was deleted.

11 changes: 1 addition & 10 deletions src/sentry/testutils/silo.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ def create_test_cells(*names: str, single_tenants: Iterable[str] = ()) -> tuple[
)


# TODO(cells): Remove alias once no longer used in getsentry
Comment thread
cursor[bot] marked this conversation as resolved.
create_test_regions = create_test_cells


def _model_silo_limit(t: type[Model]) -> ModelSiloLimit:
from sentry.db.models.base import ModelSiloLimit

Expand Down Expand Up @@ -173,8 +169,6 @@ def __call__[
self,
*,
cells: Sequence[Cell] = (),
# TODO(cells): Remove alias once no longer used in getsentry
regions: Sequence[Cell] | None = None,
include_monolith_run: bool = False,
) -> Callable[[T], T]: ...

Expand All @@ -183,16 +177,13 @@ def __call__(
decorated_obj: Any = None,
*,
cells: Sequence[Cell] = (),
# TODO(cells): Remove alias once no longer used in getsentry
regions: Sequence[Cell] | None = None,
include_monolith_run: bool = False,
) -> Any:
silo_modes = self.silo_modes
if include_monolith_run:
silo_modes |= frozenset([SiloMode.MONOLITH])

resolved_cells = tuple(cells or regions or ())
mod = _SiloModeTestModification(silo_modes=silo_modes, cells=resolved_cells)
mod = _SiloModeTestModification(silo_modes=silo_modes, cells=tuple(cells))
return mod.apply if decorated_obj is None else mod.apply(decorated_obj)


Expand Down
12 changes: 6 additions & 6 deletions tests/sentry/models/test_projectkeymapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from sentry.testutils.factories import Factories
from sentry.testutils.outbox import outbox_runner
from sentry.testutils.pytest.fixtures import django_db_all
from sentry.testutils.silo import assume_test_silo_mode, cell_silo_test, create_test_regions
from sentry.testutils.silo import assume_test_silo_mode, cell_silo_test, create_test_cells


@django_db_all(transaction=True)
@cell_silo_test(regions=create_test_regions("us"), include_monolith_run=True)
@cell_silo_test(cells=create_test_cells("us"), include_monolith_run=True)
def test_project_key_mapping_claimed_on_create() -> None:
org = Factories.create_organization()
project = Factories.create_project(organization=org)
Expand All @@ -20,7 +20,7 @@ def test_project_key_mapping_claimed_on_create() -> None:


@django_db_all(transaction=True)
@cell_silo_test(regions=create_test_regions("us"), include_monolith_run=True)
@cell_silo_test(cells=create_test_cells("us"), include_monolith_run=True)
def test_project_key_mappings_deleted_on_project_delete() -> None:
org = Factories.create_organization()
project = Factories.create_project(organization=org)
Expand All @@ -35,7 +35,7 @@ def test_project_key_mappings_deleted_on_project_delete() -> None:


@django_db_all(transaction=True)
@cell_silo_test(regions=create_test_regions("us"), include_monolith_run=True)
@cell_silo_test(cells=create_test_cells("us"), include_monolith_run=True)
def test_project_key_mapping_deleted_on_key_delete() -> None:
org = Factories.create_organization()
project = Factories.create_project(organization=org)
Expand All @@ -50,7 +50,7 @@ def test_project_key_mapping_deleted_on_key_delete() -> None:


@django_db_all(transaction=True)
@cell_silo_test(regions=create_test_regions("us"), include_monolith_run=True)
@cell_silo_test(cells=create_test_cells("us"), include_monolith_run=True)
def test_project_key_mapping_no_orphan_when_delete_coalesces_with_key_update() -> None:
"""Deletion after a public_key change must not orphan the mapping when outboxes coalesce."""
org = Factories.create_organization()
Expand All @@ -76,7 +76,7 @@ def test_project_key_mapping_no_orphan_when_delete_coalesces_with_key_update() -


@django_db_all(transaction=True)
@cell_silo_test(regions=create_test_regions("us"), include_monolith_run=True)
@cell_silo_test(cells=create_test_cells("us"), include_monolith_run=True)
def test_project_key_mapping_no_orphan_on_public_key_override() -> None:
"""
When write_relocation_import overwrites an auto-created ProjectKey with a different
Expand Down
Loading