Browse Source

fix(trends): Move trends to a separate feature flag (#30976)

- This is to investigate some issues we're currently having with this
  query
William Mak 3 years ago
parent
commit
e0fe68ce9d

+ 1 - 1
src/sentry/api/endpoints/organization_events_trends.py

@@ -415,7 +415,7 @@ class OrganizationEventsTrendsEndpointBase(OrganizationEventsV2EndpointBase):
         return features.has("organizations:performance-view", organization, actor=request.user)
 
     def has_snql_feature(self, organization, request):
-        return features.has("organizations:performance-use-snql", organization, actor=request.user)
+        return features.has("organizations:trends-use-snql", organization, actor=request.user)
 
     def get(self, request: Request, organization) -> Response:
         if not self.has_feature(organization, request):

+ 1 - 0
src/sentry/features/__init__.py

@@ -125,6 +125,7 @@ default_manager.add("organizations:performance-mobile-vitals", OrganizationFeatu
 default_manager.add("organizations:performance-ops-breakdown", OrganizationFeature)
 default_manager.add("organizations:performance-suspect-spans-view", OrganizationFeature, True)
 default_manager.add("organizations:performance-use-snql", OrganizationFeature, True)
+default_manager.add("organizations:trends-use-snql", OrganizationFeature, True)
 default_manager.add("organizations:performance-view", OrganizationFeature)
 default_manager.add("organizations:profiling", OrganizationFeature, True)
 default_manager.add("organizations:project-event-date-limit", OrganizationFeature, True)

+ 3 - 3
tests/snuba/api/endpoints/test_organization_events_trends.py

@@ -1027,7 +1027,7 @@ class OrganizationEventsTrendsEndpointTestWithSnql(OrganizationEventsTrendsEndpo
         super().setUp()
         self.features = {
             "organizations:performance-view": True,
-            "organizations:performance-use-snql": True,
+            "organizations:trends-use-snql": True,
         }
 
 
@@ -1036,7 +1036,7 @@ class OrganizationEventsTrendsStatsEndpointTestWithSnql(OrganizationEventsTrends
         super().setUp()
         self.features = {
             "organizations:performance-view": True,
-            "organizations:performance-use-snql": True,
+            "organizations:trends-use-snql": True,
         }
 
 
@@ -1045,5 +1045,5 @@ class OrganizationEventsTrendsPagingTestWithSnql(OrganizationEventsTrendsPagingT
         super().setUp()
         self.features = {
             "organizations:performance-view": True,
-            "organizations:performance-use-snql": True,
+            "organizations:trends-use-snql": True,
         }