Browse Source

feat(integrations): Remove feature flag (#20667)

Marcos Gaeta 4 years ago
parent
commit
8fe293b461

+ 0 - 2
src/sentry/conf/server.py

@@ -864,8 +864,6 @@ SENTRY_FEATURES = {
     "organizations:integrations-incident-management": True,
     # Allow orgs to install AzureDevops with limited scopes
     "organizations:integrations-vsts-limited-scopes": False,
-    # Use Sentry Apps with Metric Alerts
-    "organizations:integrations-sentry-app-metric-alerts": False,
     # Enable data forwarding functionality for organizations.
     "organizations:data-forwarding": True,
     # Enable experimental performance improvements.

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

@@ -77,9 +77,6 @@ default_manager.add("organizations:integrations-alert-rule", OrganizationFeature
 default_manager.add("organizations:integrations-chat-unfurl", OrganizationFeature)  # NOQA
 default_manager.add("organizations:integrations-incident-management", OrganizationFeature)  # NOQA
 default_manager.add("organizations:integrations-vsts-limited-scopes", OrganizationFeature)  # NOQA
-default_manager.add(
-    "organizations:integrations-sentry-app-metric-alerts", OrganizationFeature  # NOQA
-)
 default_manager.add("organizations:internal-catchall", OrganizationFeature)  # NOQA
 default_manager.add("organizations:invite-members", OrganizationFeature)  # NOQA
 default_manager.add("organizations:large-debug-files", OrganizationFeature)  # NOQA

+ 4 - 11
src/sentry/incidents/endpoints/organization_alert_rule_available_action_index.py

@@ -82,17 +82,10 @@ class OrganizationAlertRuleAvailableActionIndexEndpoint(OrganizationEndpoint):
 
             # Add all alertable SentryApps to the list.
             elif registered_type.type == AlertRuleTriggerAction.Type.SENTRY_APP:
-                if features.has(
-                    "organizations:integrations-sentry-app-metric-alerts",
-                    organization,
-                    actor=request.user,
-                ):
-                    actions += [
-                        build_action_response(registered_type, sentry_app=app)
-                        for app in get_alertable_sentry_apps(
-                            organization.id, with_metric_alerts=True
-                        )
-                    ]
+                actions += [
+                    build_action_response(registered_type, sentry_app=app)
+                    for app in get_alertable_sentry_apps(organization.id, with_metric_alerts=True)
+                ]
 
             else:
                 actions.append(build_action_response(registered_type))

+ 2 - 6
tests/sentry/incidents/endpoints/test_organization_alert_rule_available_action_index.py

@@ -143,9 +143,7 @@ class OrganizationAlertRuleAvailableActionIndexEndpointTest(APITestCase):
     def test_sentry_apps(self):
         sentry_app = self.install_new_sentry_app("foo")
 
-        with self.feature(
-            ["organizations:incidents", "organizations:integrations-sentry-app-metric-alerts"]
-        ):
+        with self.feature("organizations:incidents"):
             resp = self.get_valid_response(self.organization.slug)
 
         assert len(resp.data) == 2
@@ -157,9 +155,7 @@ class OrganizationAlertRuleAvailableActionIndexEndpointTest(APITestCase):
         # Should not show up in available actions.
         self.install_new_sentry_app("published", published=True)
 
-        with self.feature(
-            ["organizations:incidents", "organizations:integrations-sentry-app-metric-alerts"]
-        ):
+        with self.feature("organizations:incidents"):
             resp = self.get_valid_response(self.organization.slug)
 
         assert len(resp.data) == 2

+ 1 - 3
tests/sentry/incidents/endpoints/test_organization_alert_rule_details.py

@@ -139,9 +139,7 @@ class AlertRuleDetailsPutEndpointTest(AlertRuleDetailsBase, APITestCase):
             "sentryAppId": sentry_app.id,
         }
 
-        with self.feature(
-            ["organizations:incidents", "organizations:integrations-sentry-app-metric-alerts"]
-        ):
+        with self.feature("organizations:incidents"):
             resp = self.get_valid_response(
                 self.organization.slug, alert_rule.id, **serialized_alert_rule
             )

+ 3 - 9
tests/sentry/incidents/endpoints/test_organization_alert_rule_index.py

@@ -121,9 +121,7 @@ class AlertRuleCreateEndpointTest(AlertRuleIndexBase, APITestCase):
             "sentryAppId": sentry_app.id,
         }
 
-        with self.feature(
-            ["organizations:incidents", "organizations:integrations-sentry-app-metric-alerts"]
-        ):
+        with self.feature("organizations:incidents"):
             resp = self.get_valid_response(
                 self.organization.slug, status_code=201, **valid_alert_rule
             )
@@ -141,9 +139,7 @@ class AlertRuleCreateEndpointTest(AlertRuleIndexBase, APITestCase):
             "sentryAppId": 1,
         }
 
-        with self.feature(
-            ["organizations:incidents", "organizations:integrations-sentry-app-metric-alerts"]
-        ):
+        with self.feature("organizations:incidents"):
             self.get_valid_response(self.organization.slug, status_code=400, **valid_alert_rule)
 
     def test_invalid_sentry_app(self):
@@ -156,9 +152,7 @@ class AlertRuleCreateEndpointTest(AlertRuleIndexBase, APITestCase):
             "sentryAppId": "invalid",
         }
 
-        with self.feature(
-            ["organizations:incidents", "organizations:integrations-sentry-app-metric-alerts"]
-        ):
+        with self.feature("organizations:incidents"):
             self.get_valid_response(self.organization.slug, status_code=400, **valid_alert_rule)
 
     def test_no_label(self):