Browse Source

ref: use typed symbolic (#51604)

the unfiltered mypy output does not change after this patch
anthony sottile 1 year ago
parent
commit
b3bfa1b1ef

+ 0 - 1
pyproject.toml

@@ -125,7 +125,6 @@ module = [
     "sentry_relay.*",
     "sqlparse.*",
     "statsd.*",
-    "symbolic.*",
     "toronado.*",
     "u2flib_server.model.*",
     "ua_parser.user_agent_parser.*",

+ 1 - 1
requirements-base.txt

@@ -68,7 +68,7 @@ simplejson>=3.17.6
 sqlparse>=0.4.4
 statsd>=3.3
 structlog>=22
-symbolic>=12.1.2
+symbolic>=12.2.0
 toronado>=0.1.0
 typing-extensions>=4.0.0
 ua-parser>=0.10.0

+ 1 - 1
requirements-dev-frozen.txt

@@ -182,7 +182,7 @@ sqlparse==0.4.4
 statsd==3.3
 stripe==2.61.0
 structlog==22.1.0
-symbolic==12.1.2
+symbolic==12.2.0
 tokenize-rt==5.0.0
 tomli==2.0.1
 toronado==0.1.0

+ 1 - 1
requirements-frozen.txt

@@ -130,7 +130,7 @@ sqlparse==0.4.4
 statsd==3.3
 stripe==2.61.0
 structlog==22.1.0
-symbolic==12.1.2
+symbolic==12.2.0
 toronado==0.1.0
 tqdm==4.64.1
 trio==0.21.0

+ 2 - 1
src/sentry/api/endpoints/artifact_lookup.py

@@ -7,7 +7,8 @@ from django.db import router
 from django.http import Http404, HttpResponse, StreamingHttpResponse
 from rest_framework.request import Request
 from rest_framework.response import Response
-from symbolic import SymbolicError, normalize_debug_id
+from symbolic.debuginfo import normalize_debug_id
+from symbolic.exceptions import SymbolicError
 
 from sentry import options, ratelimits
 from sentry.api.base import region_silo_endpoint

+ 2 - 1
src/sentry/api/endpoints/debug_files.py

@@ -8,7 +8,8 @@ from django.db.models import Q
 from django.http import Http404, HttpResponse, StreamingHttpResponse
 from rest_framework.request import Request
 from rest_framework.response import Response
-from symbolic import SymbolicError, normalize_debug_id
+from symbolic.debuginfo import normalize_debug_id
+from symbolic.exceptions import SymbolicError
 
 from sentry import ratelimits, roles
 from sentry.api.base import region_silo_endpoint

+ 7 - 6
src/sentry/lang/java/plugin.py

@@ -1,5 +1,6 @@
 import sentry_sdk
-from symbolic import ProguardMapper, SourceView
+from symbolic.proguard import ProguardMapper
+from symbolic.sourcemap import SourceView
 
 from sentry.lang.java.processing import deobfuscate_exception_value
 from sentry.lang.java.utils import (
@@ -117,12 +118,12 @@ class JavaStacktraceProcessor(StacktraceProcessor):
 
         # second, if that is not possible, try to re-map only the class-name
         for view in self.mapping_views:
-            mapped = view.remap_class(frame["module"])
+            mapped_class = view.remap_class(frame["module"])
 
-            if mapped:
-                new_frame = dict(raw_frame)
-                new_frame["module"] = mapped
-                return [new_frame], [raw_frame], []
+            if mapped_class:
+                frame = dict(raw_frame)
+                frame["module"] = mapped_class
+                return [frame], [raw_frame], []
 
         return
 

+ 1 - 1
src/sentry/lang/java/utils.py

@@ -4,7 +4,7 @@ import os
 from typing import Any
 
 import sentry_sdk
-from symbolic import ProguardMapper
+from symbolic.proguard import ProguardMapper
 
 from sentry.attachments import CachedAttachment, attachment_cache
 from sentry.ingest.ingest_consumer import CACHE_TIMEOUT

+ 1 - 1
src/sentry/lang/javascript/cache.py

@@ -1,4 +1,4 @@
-from symbolic import SourceView
+from symbolic.sourcemap import SourceView
 
 from sentry.utils.strings import codec_lookup
 

+ 2 - 2
src/sentry/lang/javascript/processor.py

@@ -19,8 +19,8 @@ from django.conf import settings
 from django.utils import timezone
 from django.utils.encoding import force_bytes, force_text
 from requests.utils import get_encoding_from_headers
-from symbolic import SourceMapCache as SmCache
-from symbolic import SourceView
+from symbolic.sourcemap import SourceView
+from symbolic.sourcemapcache import SourceMapCache as SmCache
 
 from sentry import features, http, options
 from sentry.event_manager import set_tag

Some files were not shown because too many files changed in this diff