Skip to content

Commit 33246e5

Browse files
authored
chore(auto_config): Remove logic for unintended rules (#89732)
This has run long enough, and it's run its course. This was added in #88952 as temporary cleanup code.
1 parent 194f856 commit 33246e5

File tree

3 files changed

+1
-60
lines changed

3 files changed

+1
-60
lines changed

src/sentry/issues/auto_source_code_config/constants.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,3 @@
3333
"clojure": {"extensions": ["clj", "cljs", "cljc"]},
3434
"groovy": {"extensions": ["groovy"]},
3535
}
36-
37-
38-
# This list needs to be updated when new packages are added to the list
39-
UNINTENDED_RULES = [
40-
"stack.module:akka.** +app",
41-
"stack.module:com.fasterxml.** +app",
42-
"stack.module:com.microsoft.** +app",
43-
"stack.module:com.sun.** +app",
44-
"stack.module:feign.** +app",
45-
"stack.module:io.opentelemetry.** +app",
46-
"stack.module:jdk.** +app",
47-
"stack.module:oauth.** +app",
48-
"stack.module:org.apache.** +app",
49-
"stack.module:org.glassfish.** +app",
50-
"stack.module:org.jboss.** +app",
51-
"stack.module:org.jdesktop.** +app",
52-
"stack.module:org.postgresql.** +app",
53-
"stack.module:org.springframework.** +app",
54-
"stack.module:org.web3j.** +app",
55-
"stack.module:reactor.core.** +app",
56-
"stack.module:scala.** +app",
57-
"stack.module:sun.** +app",
58-
]

src/sentry/issues/auto_source_code_config/task.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
SCMIntegrationInteractionType,
1717
)
1818
from sentry.issues.auto_source_code_config.code_mapping import CodeMapping, CodeMappingTreesHelper
19-
from sentry.issues.auto_source_code_config.constants import UNINTENDED_RULES
2019
from sentry.locks import locks
2120
from sentry.models.organization import Organization
2221
from sentry.models.project import Project
@@ -74,15 +73,12 @@ def process_event(
7473

7574
platform = event.platform
7675
assert platform is not None
76+
set_tag("platform", platform)
7777

7878
platform_config = PlatformConfig(platform)
7979
if not platform_config.is_supported():
8080
return [], []
8181

82-
# This is a temporary solution to remove unintended rules across the board
83-
if platform_config.creates_in_app_stack_trace_rules():
84-
remove_unintended_rules(project)
85-
8682
frames_to_process = get_frames_to_process(event.data, platform)
8783
if not frames_to_process:
8884
return [], []
@@ -208,23 +204,6 @@ def create_configurations(
208204
return code_mappings, in_app_stack_trace_rules
209205

210206

211-
def remove_unintended_rules(project: Project) -> None:
212-
"""
213-
Remove unintended rules from the project's automatic grouping enhancements.
214-
"""
215-
key = "sentry:automatic_grouping_enhancements"
216-
in_app_stack_trace_rules = project.get_option(key, default="").split("\n")
217-
if not in_app_stack_trace_rules:
218-
return
219-
220-
# Remove rules that are not in the code mappings
221-
for rule in in_app_stack_trace_rules:
222-
if rule in UNINTENDED_RULES:
223-
in_app_stack_trace_rules.remove(rule)
224-
225-
project.update_option(key, "\n".join(in_app_stack_trace_rules))
226-
227-
228207
def create_code_mapping(
229208
code_mapping: CodeMapping,
230209
repository: Repository | None,

tests/sentry/issues/auto_source_code_config/test_process_event.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -885,18 +885,3 @@ def test_categorized_frames_are_not_processed(self) -> None:
885885
expected_new_code_mappings=[self.code_mapping("android/app/", "src/android/app/")],
886886
expected_new_in_app_stack_trace_rules=["stack.module:android.app.** +app"],
887887
)
888-
889-
def test_unintended_rules_are_removed(self) -> None:
890-
"""Test that unintended rules will be removed without affecting other rules"""
891-
key = "sentry:automatic_grouping_enhancements"
892-
# Let's assume that the package was not categorized, thus, we created a rule for it
893-
self.project.update_option(key, "stack.module:akka.** +app\nstack.module:foo.bar.** +app")
894-
# This module is categorized, thus, we won't attempt derivation for it
895-
frame = self.frame_from_module("com.sun.Activity", "Activity.java")
896-
event = self.create_event([frame], self.platform)
897-
898-
# The rule will be removed after calling this
899-
process_event(self.project.id, event.group_id, event.event_id)
900-
rules = self.project.get_option(key)
901-
# Other rules are not affected
902-
assert rules.split("\n") == ["stack.module:foo.bar.** +app"]

0 commit comments

Comments
 (0)