Skip to content

Commit 9dfcfcc

Browse files
committed
chore(auto_source): Remove option
Remove option and old code path from #101288.
1 parent ef9f7ef commit 9dfcfcc

File tree

7 files changed

+20
-79
lines changed

7 files changed

+20
-79
lines changed

src/sentry/issues/auto_source_code_config/constants.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
DERIVED_ENHANCEMENTS_OPTION_KEY = "sentry:derived_grouping_enhancements"
1010
SUPPORTED_INTEGRATIONS = [IntegrationProviderSlug.GITHUB.value]
1111
STACK_ROOT_MAX_LEVEL = 4
12-
# Stacktrace roots that match one of these will have an extra level of granularity
13-
# com.au, co.uk, org.uk, gov.uk, net.uk, edu.uk, ct.uk
14-
# This list does not have to be exhaustive as the fallback is two levels of granularity
15-
SECOND_LEVEL_TLDS = ("com", "co", "org", "gov", "net", "edu")
1612

1713
# Any new languages should also require updating the stacktraceLink.tsx
1814
# The extensions do not need to be exhaustive but only include the ones that show up in stacktraces

src/sentry/issues/auto_source_code_config/frame_info.py

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
from collections.abc import Mapping, Sequence
66
from typing import Any
77

8-
from sentry import options
98
from sentry.integrations.source_code_management.repo_trees import get_extension
109

11-
from .constants import SECOND_LEVEL_TLDS, STACK_ROOT_MAX_LEVEL
10+
from .constants import STACK_ROOT_MAX_LEVEL
1211
from .errors import (
1312
DoesNotFollowJavaPackageNamingConvention,
1413
MissingModuleOrAbsPath,
@@ -157,25 +156,19 @@ def get_path_from_module(module: str, abs_path: str) -> tuple[str, str]:
157156

158157

159158
def get_granularity(parts: Sequence[str]) -> int:
160-
# a.Bar, Bar.kt -> stack_root: a/, file_path: a/Bar.kt
159+
# a.Bar, Bar.kt -> stack_root: a/, file_path: a/Bar.kt
161160
granularity = 1
162161

163162
if len(parts) > 1:
164163
# com.example.foo.bar.Baz$InnerClass, Baz.kt ->
165-
# stack_root: com/example/foo/
164+
# stack_root: com/example/foo/bar/
166165
# file_path: com/example/foo/bar/Baz.kt
167-
granularity = STACK_ROOT_MAX_LEVEL - 1
168-
169-
if parts[1] in SECOND_LEVEL_TLDS:
170-
# uk.co.example.foo.bar.Baz$InnerClass, Baz.kt ->
171-
# stack_root: uk/co/example/foo/
172-
# file_path: uk/co/example/foo/bar/Baz.kt
173-
granularity = STACK_ROOT_MAX_LEVEL
174-
175-
elif options.get("auto_source_code_config.multi_module_java"):
176-
# com.example.multi.foo.bar.Baz$InnerClass, Baz.kt ->
177-
# stack_root: com/example/multi/foo/
178-
# file_path: com/example/multi/foo/bar/Baz.kt
179-
granularity = STACK_ROOT_MAX_LEVEL
166+
# uk.co.example.foo.bar.Baz$InnerClass, Baz.kt ->
167+
# stack_root: uk/co/example/foo/
168+
# file_path: uk/co/example/foo/bar/Baz.kt
169+
# com.example.multi.foo.bar.Baz$InnerClass, Baz.kt ->
170+
# stack_root: com/example/multi/foo/
171+
# file_path: com/example/multi/foo/bar/Baz.kt
172+
granularity = STACK_ROOT_MAX_LEVEL
180173

181174
return granularity

src/sentry/options/defaults.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -903,13 +903,6 @@
903903
flags=FLAG_AUTOMATOR_MODIFIABLE,
904904
)
905905

906-
register(
907-
"auto_source_code_config.multi_module_java",
908-
type=Bool,
909-
default=False,
910-
flags=FLAG_AUTOMATOR_MODIFIABLE,
911-
)
912-
913906
register(
914907
"issues.severity.first-event-severity-calculation-projects-allowlist",
915908
type=Sequence,

tests/sentry/issues/auto_source_code_config/test_frame_info.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ def test_java_raises_exception(
9090
with pytest.raises(expected_exception):
9191
create_frame_info(frame, "java")
9292

93-
# Only necessary while auto_source_code_config.multi_module_java is used
94-
@pytest.mark.django_db
9593
@pytest.mark.parametrize(
9694
"frame, expected_stack_root, expected_normalized_path",
9795
[

tests/sentry/issues/auto_source_code_config/test_process_event.py

Lines changed: 10 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,32 +1004,6 @@ def test_categorized_frames_are_not_processed(self) -> None:
10041004
expected_new_in_app_stack_trace_rules=["stack.module:android.app.** +app"],
10051005
)
10061006

1007-
def test_multi_module_with_old_granularity(self) -> None:
1008-
java_module_prefix = "com.example.multi"
1009-
module_prefix = java_module_prefix.replace(".", "/") + "/"
1010-
repo_trees = {
1011-
REPO1: [
1012-
f"modules/modX/{module_prefix}foo/Bar.kt",
1013-
f"modules/modY/{module_prefix}bar/Baz.kt",
1014-
]
1015-
}
1016-
frames = [
1017-
self.frame_from_module(f"{java_module_prefix}.foo.Bar", "Bar.kt"),
1018-
self.frame_from_module(f"{java_module_prefix}.bar.Baz", "Baz.kt"),
1019-
]
1020-
self._process_and_assert_configuration_changes(
1021-
repo_trees=repo_trees,
1022-
frames=frames,
1023-
platform=self.platform,
1024-
expected_new_code_mappings=[
1025-
# It's missing the extra granularity
1026-
# It's going to pick modY since it is the first frame processed, thus,
1027-
# the other frame will not have a working code mapping
1028-
self.code_mapping("com/example/multi/", "modules/modY/com/example/multi/")
1029-
],
1030-
expected_new_in_app_stack_trace_rules=["stack.module:com.example.** +app"],
1031-
)
1032-
10331007
def test_multi_module(self) -> None:
10341008
# Some Java projects have all modules under the same com/foo/bar directory
10351009
# however, some projects have different modules under different directories
@@ -1051,16 +1025,13 @@ def test_multi_module(self) -> None:
10511025
self.frame_from_module(f"{java_module_prefix}.foo.Bar", "Bar.kt"),
10521026
self.frame_from_module(f"{java_module_prefix}.bar.Baz", "Baz.kt"),
10531027
]
1054-
with self.options({"auto_source_code_config.multi_module_java": True}):
1055-
self._process_and_assert_configuration_changes(
1056-
repo_trees=repo_trees,
1057-
frames=frames,
1058-
platform=self.platform,
1059-
expected_new_code_mappings=[
1060-
self.code_mapping(f"{module_prefix}foo/", f"modules/modX/{module_prefix}foo/"),
1061-
self.code_mapping(f"{module_prefix}bar/", f"modules/modY/{module_prefix}bar/"),
1062-
],
1063-
expected_new_in_app_stack_trace_rules=[
1064-
f"stack.module:{java_module_prefix}.** +app"
1065-
],
1066-
)
1028+
self._process_and_assert_configuration_changes(
1029+
repo_trees=repo_trees,
1030+
frames=frames,
1031+
platform=self.platform,
1032+
expected_new_code_mappings=[
1033+
self.code_mapping(f"{module_prefix}foo/", f"modules/modX/{module_prefix}foo/"),
1034+
self.code_mapping(f"{module_prefix}bar/", f"modules/modY/{module_prefix}bar/"),
1035+
],
1036+
expected_new_in_app_stack_trace_rules=[f"stack.module:{java_module_prefix}.** +app"],
1037+
)

tests/sentry/issues/ownership/test_grammar.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,6 @@ def test_matcher_test_threads() -> None:
230230
assert not Matcher("url", "*.py").test(data, munged_data)
231231

232232

233-
# Only necessary while auto_source_code_config.multi_module_java is used
234-
@pytest.mark.django_db
235233
def test_matcher_test_platform_java_threads() -> None:
236234
data = {
237235
"platform": "java",

tests/sentry/utils/test_event_frames.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import unittest
22

3-
import pytest
4-
53
from sentry.testutils.cases import TestCase
64
from sentry.utils.event_frames import (
75
EventFrame,
@@ -78,8 +76,6 @@ def test_platform_other(self) -> None:
7876
def test_platform_sdk_name_not_supported(self) -> None:
7977
assert not munged_filename_and_frames("javascript", [], "munged", "sdk.other")
8078

81-
# Only necessary while auto_source_code_config.multi_module_java is used
82-
@pytest.mark.django_db
8379
def test_supported_platform_sdk_name_not_required(self) -> None:
8480
frames = [
8581
{
@@ -92,8 +88,6 @@ def test_supported_platform_sdk_name_not_required(self) -> None:
9288

9389

9490
class JavaFilenameMungingTestCase(unittest.TestCase):
95-
# Only necessary while auto_source_code_config.multi_module_java is used
96-
@pytest.mark.django_db
9791
def test_platform_java(self) -> None:
9892
frames = [
9993
{
@@ -146,8 +140,6 @@ def test_platform_java_do_not_follow_java_package_naming_convention_does_not_rai
146140
munged = munged_filename_and_frames("java", [frame])
147141
assert munged is None
148142

149-
# Only necessary while auto_source_code_config.multi_module_java is used
150-
@pytest.mark.django_db
151143
def test_platform_android_kotlin(self) -> None:
152144
exception_frames = [
153145
{

0 commit comments

Comments
 (0)