Browse Source

chore(hybridcloud) Remove TODOs that are done/outdated (#62127)

Do some cleanup on the TODOs we have been leaving behind.
Mark Story 1 year ago
parent
commit
b0ff7adf6e

+ 0 - 1
src/sentry/api/serializers/models/team.py

@@ -361,7 +361,6 @@ class TeamWithProjectsSerializer(TeamSerializer):
 def get_scim_teams_members(
     team_list: Sequence[Team],
 ) -> MutableMapping[Team, MutableSequence[MutableMapping[str, Any]]]:
-    # TODO(hybridcloud) Another cross silo join
     members = RangeQuerySetWrapper(
         OrganizationMember.objects.filter(teams__in=team_list)
         .prefetch_related("teams")

+ 2 - 1
src/sentry/models/useremail.py

@@ -16,6 +16,7 @@ from sentry.db.models import BaseManager, FlexibleForeignKey, control_silo_only_
 from sentry.db.models.outboxes import ControlOutboxProducingModel
 from sentry.models.outbox import ControlOutboxBase, OutboxCategory
 from sentry.services.hybrid_cloud.organization.model import RpcOrganization
+from sentry.services.hybrid_cloud.user.model import RpcUser
 from sentry.types.region import find_regions_for_user
 from sentry.utils.security import get_secure_token
 
@@ -37,7 +38,7 @@ class UserEmailManager(BaseManager["UserEmail"]):
             emails_by_user[entry.user].add(entry.email)
         return emails_by_user
 
-    def get_primary_email(self, user: User) -> UserEmail:
+    def get_primary_email(self, user: RpcUser | User) -> UserEmail:
         user_email, _ = self.get_or_create(user_id=user.id, email=user.email)
         return user_email
 

+ 0 - 2
src/sentry/snuba/tasks.py

@@ -33,8 +33,6 @@ logger = logging.getLogger(__name__)
 SUBSCRIPTION_STATUS_MAX_AGE = timedelta(minutes=10)
 
 
-# TODO(hybrid-cloud): Mark this as region silo only once testing/decorator
-#  interaction is cleaned up
 @instrumented_task(
     name="sentry.snuba.tasks.create_subscription_in_snuba",
     queue="subscriptions",

+ 0 - 9
src/sentry/tasks/email.py

@@ -24,16 +24,7 @@ def _get_user_from_email(group: Group, email: str) -> Optional[RpcUser]:
     return None
 
 
-@instrumented_task(
-    name="sentry.tasks.email.process_inbound_email",
-    queue="email.inbound",
-    default_retry_delay=60 * 5,
-    max_retries=None,
-    silo_mode=SiloMode.REGION,
-)
 def process_inbound_email(mailfrom: str, group_id: int, payload: str):
-    # TODO(hybridcloud) Once we aren't invoking this with celery
-    # detach  this from celery and have a basic function instead.
     from sentry.models.group import Group
     from sentry.web.forms import NewNoteForm
 

+ 0 - 1
static/app/actionCreators/organizations.tsx

@@ -219,7 +219,6 @@ export async function fetchOrganizations(api: Client, query?: Record<string, any
   const results = await Promise.all(
     regions.map(region =>
       api.requestPromise(`/organizations/`, {
-        // TODO(hybridcloud) Revisit this once domain splitting is working
         host: region.url,
         query,
       })

+ 0 - 1
tests/sentry/api/endpoints/test_user_notification_email.py

@@ -39,7 +39,6 @@ class UserNotificationEmailGetTest(UserNotificationEmailTestBase):
         }
 
 
-# TODO(hybrid-cloud): Fix underlying logic, which is not silo safe
 @control_silo_test()
 class UserNotificationEmailTest(UserNotificationEmailTestBase):
     method = "put"

+ 0 - 3
tests/sentry/tasks/test_email.py

@@ -10,9 +10,6 @@ pytestmark = [requires_snuba]
 
 @region_silo_test
 class ProcessInboundEmailTest(TestCase):
-    def test_task_persistent_name(self):
-        assert process_inbound_email.name == "sentry.tasks.email.process_inbound_email"
-
     def test_simple(self):
         group = self.create_group()
 

+ 1 - 1
webpack.config.ts

@@ -561,7 +561,7 @@ if (
     let controlSiloProxy = {};
     if (CONTROL_SILO_PORT) {
       // TODO(hybridcloud) We also need to use this URL pattern
-      // list to select contro/region when making API requests in non-proxied
+      // list to select control/region when making API requests in non-proxied
       // environments (like production). We'll likely need a way to consolidate this
       // with the configuration api.Client uses.
       const controlSiloAddress = `http://127.0.0.1:${CONTROL_SILO_PORT}`;