Skip to content

Commit

Permalink
chore(hybrid-cloud): Delete ControlSiloClient (getsentry#60645)
Browse files Browse the repository at this point in the history
  • Loading branch information
dashed authored Nov 27, 2023
1 parent 23ccec3 commit d5166f4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
18 changes: 0 additions & 18 deletions src/sentry/silo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from typing import Any, Iterable, Mapping

from django.conf import settings
from django.http import HttpResponse
from django.http.request import HttpRequest
from requests import Request
Expand Down Expand Up @@ -122,20 +121,3 @@ def __init__(self, region: Region) -> None:
# Ensure the region is registered
self.region = get_region_by_name(region.name)
self.base_url = self.region.address


class ControlSiloClient(BaseSiloClient):
access_modes = [SiloMode.REGION]

metrics_prefix = "silo_client.control"
log_path = "sentry.silo.client.control"
silo_client_name = "control"

def __init__(self) -> None:
super().__init__()

self.base_url = getattr(settings, "SENTRY_CONTROL_ADDRESS")
if not self.base_url:
raise AttributeError(
"Configure 'SENTRY_CONTROL_ADDRESS' in sentry configuration settings to use the ControlSiloClient"
)
12 changes: 1 addition & 11 deletions tests/sentry/silo/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from sentry.shared_integrations.response.base import BaseApiResponse
from sentry.silo import SiloMode
from sentry.silo.client import ControlSiloClient, RegionSiloClient, SiloClientError
from sentry.silo.client import RegionSiloClient, SiloClientError
from sentry.silo.util import PROXY_DIRECT_LOCATION_HEADER, PROXY_SIGNATURE_HEADER
from sentry.testutils.cases import TestCase
from sentry.testutils.region import override_regions
Expand All @@ -22,18 +22,12 @@ def setUp(self):

@override_settings(SILO_MODE=SiloMode.MONOLITH)
def test_init_clients_from_monolith(self):
with raises(SiloClientError):
ControlSiloClient()

with raises(SiloClientError):
RegionSiloClient(self.region)

@override_settings(SILO_MODE=SiloMode.CONTROL)
def test_init_clients_from_control(self):
with override_regions(self.region_config):
with raises(SiloClientError):
ControlSiloClient()

with raises(SiloClientError):
RegionSiloClient("atlantis") # type: ignore[arg-type]

Expand All @@ -51,10 +45,6 @@ def test_init_clients_from_region(self):
with raises(SiloClientError):
RegionSiloClient(self.region)

client = ControlSiloClient()
assert client.base_url is not None
assert self.dummy_address in client.base_url

@responses.activate
@override_settings(SILO_MODE=SiloMode.CONTROL)
def test_client_request(self):
Expand Down

0 comments on commit d5166f4

Please sign in to comment.