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
8 changes: 0 additions & 8 deletions src/sentry/hybridcloud/models/outbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,6 @@ class Meta:
__repr__ = sane_repr("payload", *coalesced_columns)


# TODO(cells): remove once getsentry updated
RegionOutboxBase = CellOutboxBase


@cell_silo_model
class CellOutbox(CellOutboxBase):
class Meta:
Expand All @@ -461,10 +457,6 @@ class Meta:
)


# TODO(cells): remove once all usage is updated
RegionOutbox = CellOutbox


# Outboxes bound from control silo -> region silo
class ControlOutboxBase(OutboxBase):
sharding_columns = ("cell_name", "shard_scope", "shard_identifier")
Expand Down
4 changes: 0 additions & 4 deletions src/sentry/hybridcloud/rpc/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,6 @@ def decorator(method: Callable[..., _T]) -> Callable[..., _T]:
return decorator


# TODO(cells): remove once getsentry updated
regional_rpc_method = cell_rpc_method


_global_service_registry: dict[str, DelegatingRpcService] = {}


Expand Down
6 changes: 0 additions & 6 deletions src/sentry/issues/services/issue/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ def get_shared_for_cell(self, *, cell_name: str, share_id: str) -> RpcGroupShare

return RpcGroupShareMetadata(title=group.title, message=group.message)

# TODO(cells): Deprecated in favor of get_shared_for_cell
def get_shared_for_region(
self, *, region_name: str, share_id: str
) -> RpcGroupShareMetadata | None:
return self.get_shared_for_cell(cell_name=region_name, share_id=share_id)

def upsert_issue_email_reply(
self, *, organization_id: int, group_id: int, from_email: str, text: str
) -> None:
Expand Down
8 changes: 0 additions & 8 deletions src/sentry/issues/services/issue/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ def get_shared_for_org(self, *, slug: str, share_id: str) -> RpcGroupShareMetada
def get_shared_for_cell(self, *, cell_name: str, share_id: str) -> RpcGroupShareMetadata | None:
pass

# TODO(cells): Deprecated in favor of get_shared_for_cell
@cell_rpc_method(resolve=ByCellName(), return_none_if_mapping_not_found=True)
@abstractmethod
def get_shared_for_region(
self, *, region_name: str, share_id: str
) -> RpcGroupShareMetadata | None:
pass

@cell_rpc_method(resolve=ByOrganizationId(), return_none_if_mapping_not_found=True)
@abstractmethod
def upsert_issue_email_reply(
Expand Down
6 changes: 0 additions & 6 deletions src/sentry/projects/services/project_key/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,3 @@ def get_project_key_by_cell(
self, *, cell_name: str, project_id: int, role: ProjectKeyRole
) -> RpcProjectKey | None:
return self._get_project_key(project_id=project_id, role=role)

# TODO(cells): Deprecated in favor of get_project_key_by_cell
def get_project_key_by_region(
self, *, region_name: str, project_id: int, role: ProjectKeyRole
) -> RpcProjectKey | None:
return self.get_project_key_by_cell(cell_name=region_name, project_id=project_id, role=role)
8 changes: 0 additions & 8 deletions src/sentry/projects/services/project_key/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,5 @@ def get_project_key_by_cell(
) -> RpcProjectKey | None:
pass

# TODO(cells): Deprecated in favor of get_project_key_by_cell
@cell_rpc_method(resolve=ByCellName())
@abstractmethod
def get_project_key_by_region(
self, *, region_name: str, project_id: int, role: ProjectKeyRole
) -> RpcProjectKey | None:
pass


project_key_service = ProjectKeyService.create_delegation()
12 changes: 0 additions & 12 deletions src/sentry/sentry_apps/services/app_request/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,3 @@ def get_buffer_requests_for_cell(
serialize_rpc_sentry_app_request(req)
for req in buffer.get_requests(event=event, errors_only=errors_only)
]

# TODO(cells): Deprecated in favor of get_buffer_requests_for_cell
def get_buffer_requests_for_region(
self,
*,
sentry_app_id: str,
region_name: str,
filter: SentryAppRequestFilterArgs | None = None,
) -> list[RpcSentryAppRequest] | None:
return self.get_buffer_requests_for_cell(
cell_name=region_name, sentry_app_id=sentry_app_id, filter=filter
)
12 changes: 0 additions & 12 deletions src/sentry/sentry_apps/services/app_request/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,5 @@ def get_buffer_requests_for_cell(
) -> list[RpcSentryAppRequest] | None:
pass

# TODO(cells): Deprecated in favor of get_buffer_requests_for_cell
@cell_rpc_method(resolve=ByCellName())
@abc.abstractmethod
def get_buffer_requests_for_region(
self,
*,
sentry_app_id: str,
region_name: str,
filter: SentryAppRequestFilterArgs | None = None,
) -> list[RpcSentryAppRequest] | None:
pass


app_request_service = SentryAppRequestService.create_delegation()
3 changes: 0 additions & 3 deletions src/sentry/testutils/silo.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,6 @@ def apply(self, decorated_obj: Any) -> Any:
expected to pass with the current silo mode set to REGION.
"""

# TODO(cells): Remove alias once no longer used in getsentry
region_silo_test = cell_silo_test


# assume_test_silo_mode vs assume_test_silo_mode_of: What's the difference?
#
Expand Down
8 changes: 0 additions & 8 deletions src/sentry/types/region.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,6 @@ def subdomain_is_locality(request: HttpRequest) -> bool:
return get_global_directory().get_locality_by_name(subdomain) is not None


# TODO(cells): Remove alias once getsentry import sites are updated
subdomain_is_region = subdomain_is_locality


@control_silo_function
def get_cell_for_organization(organization_id_or_slug: str) -> Cell:
"""Resolve an organization to the cell where its data is stored."""
Expand Down Expand Up @@ -433,10 +429,6 @@ def get_local_cell() -> Cell:
return get_cell_by_name(settings.SENTRY_REGION)


# TODO(cells): Remove alias once getsentry import sites are updated
get_local_region = get_local_cell


@control_silo_function
def _find_orgs_for_user(user_id: int) -> set[int]:
from sentry.models.organizationmembermapping import OrganizationMemberMapping
Expand Down
26 changes: 13 additions & 13 deletions tests/sentry/sentry_apps/services/test_app_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ def setUp(self) -> None:
},
)

def test_get_buffer_requests_for_region(self) -> None:
def test_get_buffer_requests_for_cell(self) -> None:
buffer = SentryAppWebhookRequestsBuffer(self.app)
buffer.add_request(
response_code=200,
org_id=self.org.id,
event="issue.assigned",
url=self.app.webhook_url,
)
requests = app_request_service.get_buffer_requests_for_region(
sentry_app_id=self.app.id, region_name="us"
requests = app_request_service.get_buffer_requests_for_cell(
sentry_app_id=self.app.id, cell_name="us"
)
assert requests and len(requests) == 1
assert requests[0].organization_id == self.org.id

def test_get_buffer_requests_for_region_with_error_request(self) -> None:
def test_get_buffer_requests_for_cell_with_error_request(self) -> None:
buffer = SentryAppWebhookRequestsBuffer(self.app)

mock_response = Mock(spec=Response)
Expand All @@ -71,8 +71,8 @@ def test_get_buffer_requests_for_region_with_error_request(self) -> None:
"Content-Type": "application/json",
},
)
requests = app_request_service.get_buffer_requests_for_region(
sentry_app_id=self.app.id, region_name="us"
requests = app_request_service.get_buffer_requests_for_cell(
sentry_app_id=self.app.id, cell_name="us"
)
assert requests and len(requests) == 1
assert requests[0].error_id == "abc123"
Expand All @@ -83,7 +83,7 @@ def test_get_buffer_requests_for_region_with_error_request(self) -> None:
}
assert requests[0].response_body == json.dumps(mock_response.content)

def test_get_filtered_buffer_requests_for_region(self) -> None:
def test_get_filtered_buffer_requests_for_cell(self) -> None:
buffer = SentryAppWebhookRequestsBuffer(self.app)
buffer.add_request(
response_code=200,
Expand All @@ -98,21 +98,21 @@ def test_get_filtered_buffer_requests_for_region(self) -> None:
url=self.app.webhook_url,
)
filter: SentryAppRequestFilterArgs = {"event": "issue.assigned"}
requests = app_request_service.get_buffer_requests_for_region(
sentry_app_id=self.app.id, region_name="us", filter=filter
requests = app_request_service.get_buffer_requests_for_cell(
sentry_app_id=self.app.id, cell_name="us", filter=filter
)
assert requests and len(requests) == 1
assert requests[0].organization_id == self.org.id

def test_empty_buffer(self) -> None:
requests = app_request_service.get_buffer_requests_for_region(
sentry_app_id=self.app.id, region_name="us"
requests = app_request_service.get_buffer_requests_for_cell(
sentry_app_id=self.app.id, cell_name="us"
)
assert requests == []

def test_invalid_app_id(self) -> None:
requests = app_request_service.get_buffer_requests_for_region(
requests = app_request_service.get_buffer_requests_for_cell(
sentry_app_id=-1,
region_name="us",
cell_name="us",
)
assert requests is None
4 changes: 2 additions & 2 deletions tests/sentry/utils/sentry_apps/test_webhook_timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
from sentry.testutils.cases import TestCase
from sentry.testutils.helpers.features import with_feature
from sentry.testutils.helpers.options import override_options
from sentry.testutils.silo import region_silo_test
from sentry.testutils.silo import cell_silo_test
from sentry.utils.sentry_apps.webhooks import WebhookTimeoutError, send_and_save_webhook_request


@region_silo_test
@cell_silo_test
class WebhookTimeoutTest(TestCase):
def setUp(self):
self.organization = self.create_organization()
Expand Down
Loading