Skip to content

Commit 826bfb5

Browse files
ref(dx): Move nodestore to services (#97715)
1 parent 538ae42 commit 826bfb5

38 files changed

+695
-602
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,6 @@ module = [
516516
"sentry.monitors.consumers.monitor_consumer",
517517
"sentry.monkey.*",
518518
"sentry.net.socket",
519-
"sentry.nodestore.*",
520519
"sentry.notifications.platform.*",
521520
"sentry.notifications.services.*",
522521
"sentry.options.rollout",
@@ -559,6 +558,7 @@ module = [
559558
"sentry.services.eventstore.processing.*",
560559
"sentry.services.eventstore.reprocessing.*",
561560
"sentry.services.eventstore.snuba.backend",
561+
"sentry.services.nodestore.*",
562562
"sentry.shared_integrations.exceptions.*",
563563
"sentry.slug.*",
564564
"sentry.snuba.metrics.extraction",
@@ -725,7 +725,6 @@ module = [
725725
"tests.sentry.middleware.test_reporting_endpoint",
726726
"tests.sentry.models.fixtures.*",
727727
"tests.sentry.net.*",
728-
"tests.sentry.nodestore.*",
729728
"tests.sentry.notifications.notification_action.metric_alert_registry.*",
730729
"tests.sentry.notifications.notifications.organization_request.*",
731730
"tests.sentry.notifications.platform.*",
@@ -768,6 +767,7 @@ module = [
768767
"tests.sentry.sentry_apps.web.*",
769768
"tests.sentry.services.eventstore.processing.*",
770769
"tests.sentry.services.eventstore.snuba.*",
770+
"tests.sentry.services.nodestore.*",
771771
"tests.sentry.snuba.metrics.test_metrics_query_layer.*",
772772
"tests.sentry.tasks.integrations.*",
773773
"tests.sentry.tasks.snapshots.*",

src/sentry/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ def active_request(self, request: HttpRequest) -> Generator[None]:
3535
from sentry.buffer import backend as buffer # NOQA
3636
from sentry.digests import backend as digests # NOQA
3737
from sentry.locks import locks # NOQA
38-
from sentry.nodestore import backend as nodestore # NOQA
3938
from sentry.quotas import backend as quotas # NOQA
4039
from sentry.ratelimits import backend as ratelimiter # NOQA
40+
from sentry.services.nodestore import backend as nodestore # NOQA

src/sentry/backup/imports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
from sentry.hybridcloud.outbox.category import OutboxCategory, OutboxScope
4242
from sentry.models.importchunk import ControlImportChunkReplica
4343
from sentry.models.orgauthtoken import OrgAuthToken
44-
from sentry.nodestore.django.models import Node
44+
from sentry.services.nodestore.django.models import Node
4545
from sentry.silo.base import SiloMode
4646
from sentry.silo.safety import unguarded_write
4747
from sentry.utils.env import is_split_db

src/sentry/conf/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ def env(
404404
"sentry.deletions",
405405
"sentry.discover",
406406
"sentry.analytics.events",
407-
"sentry.nodestore",
407+
"sentry.services.nodestore",
408408
"sentry.users",
409409
"sentry.sentry_apps",
410410
"sentry.integrations",
@@ -2164,7 +2164,7 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:
21642164
SENTRY_SNUBA_CACHE_TTL_SECONDS = 60
21652165

21662166
# Node storage backend
2167-
SENTRY_NODESTORE = "sentry.nodestore.django.DjangoNodeStorage"
2167+
SENTRY_NODESTORE = "sentry.services.nodestore.django.DjangoNodeStorage"
21682168
SENTRY_NODESTORE_OPTIONS: dict[str, Any] = {}
21692169

21702170
# Tag storage backend

src/sentry/nodestore/__init__.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
from django.conf import settings
1+
"""
2+
Backward compatibility shim for getsentry.
23
3-
from sentry.utils.services import LazyServiceWrapper
4+
This module re-exports everything from the new sentry.services.nodestore location
5+
to maintain compatibility with existing getsentry imports.
6+
"""
47

5-
from .base import NodeStorage
6-
7-
backend = LazyServiceWrapper(
8-
NodeStorage,
9-
settings.SENTRY_NODESTORE,
10-
settings.SENTRY_NODESTORE_OPTIONS,
11-
metrics_path="nodestore",
12-
)
13-
backend.expose(locals())
8+
# Re-export everything from the new location
9+
from sentry.services.nodestore import * # noqa: F401, F403
10+
from sentry.services.nodestore import backend # noqa: F401

0 commit comments

Comments
 (0)