Browse Source

chore(issues): Cleanup code for javascript console errors (#60915)

Remove the feature and flag for the unused feature. These errors are
fixed at the browser level.
Snigdha Sharma 1 year ago
parent
commit
3131aab75b

+ 1 - 7
src/sentry/api/endpoints/organization_tags.py

@@ -2,7 +2,7 @@ import sentry_sdk
 from rest_framework.request import Request
 from rest_framework.response import Response
 
-from sentry import features, tagstore
+from sentry import tagstore
 from sentry.api.api_owners import ApiOwner
 from sentry.api.api_publish_status import ApiPublishStatus
 from sentry.api.base import region_silo_endpoint
@@ -37,12 +37,6 @@ class OrganizationTagsEndpoint(OrganizationEventsEndpointBase):
                     include_transactions=request.GET.get("include_transactions", "1") == "1",
                     tenant_ids={"organization_id": organization.id},
                 )
-                if not features.has(
-                    "organizations:javascript-console-error-tag",
-                    organization,
-                    actor=None,
-                ):
-                    results = [tag for tag in results if tag != "empty_stacktrace.js_console"]
 
                 # Filter out device.class from tags since it's already specified as a field in the frontend.
                 # This prevents the tag from being displayed twice.

+ 0 - 8
src/sentry/api/issue_search.py

@@ -271,14 +271,6 @@ def convert_query_values(
         elif isinstance(search_filter, str):
             return search_filter
 
-        if search_filter.key.name == "empty_stacktrace.js_console":
-            if not features.has(
-                "organizations:javascript-console-error-tag", organization, actor=None
-            ):
-                raise InvalidSearchQuery(
-                    "The empty_stacktrace.js_console filter is not supported for this organization"
-                )
-
         if search_filter.key.name in value_converters:
             converter = value_converters[search_filter.key.name]
             new_value = converter(

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

@@ -1435,8 +1435,6 @@ SENTRY_FEATURES: dict[str, bool | None] = {
     "organizations:alert-migration-ui": False,
     # Enables the migration of alerts (checked in a migration script).
     "organizations:alerts-migration-enabled": False,
-    # Enables tagging javascript errors from the browser console.
-    "organizations:javascript-console-error-tag": False,
     # Enables the cron job to auto-enable codecov integrations.
     "organizations:auto-enable-codecov": False,
     # The overall flag for codecov integration, gated by plans.

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

@@ -66,7 +66,6 @@ default_manager.add("relocation:enabled", SystemFeature, FeatureHandlerStrategy.
 default_manager.add("organizations:multi-region-selector", SystemFeature, FeatureHandlerStrategy.INTERNAL)
 
 # Organization scoped features that are in development or in customer trials.
-default_manager.add("organizations:javascript-console-error-tag", OrganizationFeature, FeatureHandlerStrategy.INTERNAL)
 default_manager.add("organizations:alert-allow-indexed", OrganizationFeature, FeatureHandlerStrategy.REMOTE)
 default_manager.add("organizations:alert-crash-free-metrics", OrganizationFeature, FeatureHandlerStrategy.REMOTE)
 default_manager.add("organizations:alert-filters", OrganizationFeature, FeatureHandlerStrategy.INTERNAL)

+ 0 - 17
tests/sentry/api/test_issue_search.py

@@ -162,23 +162,6 @@ class ParseSearchQueryTest(unittest.TestCase):
         ]
 
 
-@region_silo_test
-class ConvertJavaScriptConsoleTagTest(TestCase):
-    def test_valid(self):
-        filters = [SearchFilter(SearchKey("empty_stacktrace.js_console"), "=", SearchValue(True))]
-        with self.feature("organizations:javascript-console-error-tag"):
-            result = convert_query_values(filters, [self.project], self.user, None)
-            assert result[0].value.raw_value is True
-
-    def test_invalid(self):
-        filters = [SearchFilter(SearchKey("empty_stacktrace.js_console"), "=", SearchValue(True))]
-        with self.feature({"organizations:javascript-console-error-tag": False}) and pytest.raises(
-            InvalidSearchQuery,
-            match="The empty_stacktrace.js_console filter is not supported for this organization",
-        ):
-            convert_query_values(filters, [self.project], self.user, None)
-
-
 @region_silo_test
 class ConvertQueryValuesTest(TestCase):
     def test_valid_assign_me_converter(self):

+ 0 - 2
tests/snuba/api/endpoints/test_organization_tags.py

@@ -3,13 +3,11 @@ from unittest import mock
 from django.urls import reverse
 
 from sentry.testutils.cases import APITestCase, SnubaTestCase
-from sentry.testutils.helpers import apply_feature_flag_on_cls
 from sentry.testutils.helpers.datetime import before_now, iso_format
 from sentry.testutils.silo import region_silo_test
 
 
 @region_silo_test
-@apply_feature_flag_on_cls("organizations:javascript-console-error-tag")
 class OrganizationTagsTest(APITestCase, SnubaTestCase):
     def setUp(self):
         super().setUp()