Skip to content

Commit

Permalink
chore(hybridcloud) Put relay models in region (#53371)
Browse files Browse the repository at this point in the history
All of the relay related endpoints are currently in region silo, but we
had incorrectly put Relay models in control. Relay and ingestion in
general are region bound. Add stable=true for relay endpoint tests.
  • Loading branch information
markstory committed Jul 24, 2023
1 parent 3820010 commit 4a2bbbc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/sentry/models/relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from django.utils.functional import cached_property
from sentry_relay import PublicKey

from sentry.db.models import Model, control_silo_only_model
from sentry.db.models import Model, region_silo_only_model


@control_silo_only_model
@region_silo_only_model
class RelayUsage(Model):
__include_in_export__ = True

Expand All @@ -22,7 +22,7 @@ class Meta:
db_table = "sentry_relayusage"


@control_silo_only_model
@region_silo_only_model
class Relay(Model):
__include_in_export__ = True

Expand Down
2 changes: 1 addition & 1 deletion tests/sentry/api/endpoints/test_relay_projectids.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _get_all_keys(config):
yield key


@region_silo_test
@region_silo_test(stable=True)
class RelayProjectIdsEndpointTest(APITestCase):
_date_regex = re.compile(r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z$")

Expand Down
2 changes: 2 additions & 0 deletions tests/sentry/api/endpoints/test_relay_publickeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
from sentry.auth import system
from sentry.models import Relay
from sentry.testutils import APITestCase
from sentry.testutils.silo import region_silo_test
from sentry.utils import json


def disable_internal_networks():
return mock.patch.object(system, "INTERNAL_NETWORKS", ())


@region_silo_test(stable=True)
class RelayPublicKeysConfigTest(APITestCase):
def setUp(self):
super().setUp()
Expand Down
2 changes: 2 additions & 0 deletions tests/sentry/api/endpoints/test_relay_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@

from sentry.models import Relay, RelayUsage
from sentry.testutils import APITestCase
from sentry.testutils.silo import region_silo_test
from sentry.utils import json


@region_silo_test(stable=True)
class RelayRegisterTest(APITestCase):
def setUp(self):
super().setUp()
Expand Down

0 comments on commit 4a2bbbc

Please sign in to comment.