Skip to content

Commit 1e8bc06

Browse files
committed
[IMP] bump sentry_sdk version
1 parent b365eef commit 1e8bc06

File tree

7 files changed

+16
-18
lines changed

7 files changed

+16
-18
lines changed

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ dataclasses
44
mako
55
odoorpc
66
openupgradelib
7-
sentry_sdk<=1.9.0
7+
sentry_sdk>=2.0.0

sentry/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"installable": True,
1818
"external_dependencies": {
1919
"python": [
20-
"sentry_sdk<=1.9.0",
20+
"sentry_sdk>=2.0.0",
2121
]
2222
},
2323
"depends": [

sentry/const.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ def get_sentry_options():
8181
SentryOption("dsn", "", str.strip),
8282
SentryOption("transport", DEFAULT_OPTIONS["transport"], select_transport),
8383
SentryOption("logging_level", DEFAULT_LOG_LEVEL, get_sentry_logging),
84-
SentryOption("with_locals", DEFAULT_OPTIONS["with_locals"], None),
84+
SentryOption(
85+
"include_local_variables", DEFAULT_OPTIONS["include_local_variables"], None
86+
),
8587
SentryOption(
8688
"max_breadcrumbs", DEFAULT_OPTIONS["max_breadcrumbs"], to_int_if_defined
8789
),
@@ -107,7 +109,9 @@ def get_sentry_options():
107109
SentryOption("http_proxy", DEFAULT_OPTIONS["http_proxy"], None),
108110
SentryOption("https_proxy", DEFAULT_OPTIONS["https_proxy"], None),
109111
SentryOption("ignore_exceptions", DEFAULT_IGNORED_EXCEPTIONS, split_multiple),
110-
SentryOption("request_bodies", DEFAULT_OPTIONS["request_bodies"], None),
112+
SentryOption(
113+
"max_request_body_size", DEFAULT_OPTIONS["max_request_body_size"], None
114+
),
111115
SentryOption("attach_stacktrace", DEFAULT_OPTIONS["attach_stacktrace"], None),
112116
SentryOption("ca_certs", DEFAULT_OPTIONS["ca_certs"], None),
113117
SentryOption("propagate_traces", DEFAULT_OPTIONS["propagate_traces"], None),

sentry/hooks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def initialize_sentry(config):
143143
# Patch the wsgi server in case of further registration
144144
odoo.http.Application = SentryWsgiMiddleware(odoo.http.Application)
145145

146-
with sentry_sdk.push_scope() as scope:
146+
with sentry_sdk.new_scope() as scope:
147147
scope.set_extra("debug", False)
148148
sentry_sdk.capture_message("Starting Odoo Server", "info")
149149

sentry/logutils.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import os.path
55
import urllib.parse
66

7-
from sentry_sdk._compat import text_type
87
from werkzeug import datastructures
98

109
from .generalutils import get_environ
@@ -81,7 +80,7 @@ def fetch_git_sha(path, head=None):
8180
)
8281

8382
with open(head_path) as fp:
84-
head = text_type(fp.read()).strip()
83+
head = str(fp.read()).strip()
8584

8685
if head.startswith("ref: "):
8786
head = head[5:]
@@ -110,9 +109,9 @@ def fetch_git_sha(path, head=None):
110109
except ValueError:
111110
continue
112111
if ref == head:
113-
return text_type(revision)
112+
return str(revision)
114113

115114
raise InvalidGitRepository(f"Unable to find ref to head {head} in repository")
116115

117116
with open(revision_file) as fh:
118-
return text_type(fh.read()).strip()
117+
return str(fh.read()).strip()

sentry/processor.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
import re
88

9-
from sentry_sdk._compat import text_type
10-
119
from .generalutils import string_types, varmap
1210

1311

@@ -51,7 +49,7 @@ def sanitize(self, item, value):
5149
if isinstance(item, bytes):
5250
item = item.decode("utf-8", "replace")
5351
else:
54-
item = text_type(item)
52+
item = str(item)
5553

5654
item = item.lower()
5755
for key in self.sanitize_keys:

sentry/tests/test_client.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,14 @@ def __init__(self, *args, **kwargs):
4040
self.events = []
4141
self.envelopes = []
4242

43-
def capture_event(self, event, *args, **kwargs):
44-
self.events.append(event)
45-
4643
def capture_envelope(self, envelope, *args, **kwargs):
4744
self.envelopes.append(envelope)
4845

4946
def has_event(self, event_level, event_msg):
50-
for event in self.events:
47+
for event in self.envelopes:
5148
if (
52-
event.get("level") == event_level
53-
and event.get("logentry", {}).get("message") == event_msg
49+
event.get_event().get("level") == event_level
50+
and event.get_event().get("logentry", {}).get("message") == event_msg
5451
):
5552
return True
5653
return False

0 commit comments

Comments
 (0)