Skip to content

Commit 3c27e36

Browse files
authored
Merge branch 'master' into py-2352-migrate-quart
2 parents 662179a + f17dad9 commit 3c27e36

16 files changed

Lines changed: 230 additions & 67 deletions

File tree

.github/workflows/changelog-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ permissions:
1515

1616
jobs:
1717
changelog-preview:
18-
uses: getsentry/craft/.github/workflows/changelog-preview.yml@4468eb9e399655a61c770534dacc03139d98aa18 # v2
18+
uses: getsentry/craft/.github/workflows/changelog-preview.yml@6143e76379c342e247687c4ab5c83d8b900cc273 # v2
1919
secrets: inherit

.github/workflows/flaky-test-detector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
# and the repo, and writes the issue body to flaky-issue-body.md.
109109
- name: Analyze logs and summarize flaky tests
110110
if: steps.collect.outputs.collected != '0'
111-
uses: anthropics/claude-code-action@fbda2eb1bdc90d319b8d853f5deb53bca199a7c1 # v1.0.140
111+
uses: anthropics/claude-code-action@11ba60486e4aec9ddfeafcf4bb3f00b028ac2c16 # v1.0.142
112112
with:
113113
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
114114
github_token: ${{ github.token }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
token: ${{ steps.token.outputs.token }}
3232
fetch-depth: 0
3333
- name: Prepare release
34-
uses: getsentry/craft@4468eb9e399655a61c770534dacc03139d98aa18 # v2.26.8
34+
uses: getsentry/craft@6143e76379c342e247687c4ab5c83d8b900cc273 # v2.26.9
3535
env:
3636
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
3737
with:

.github/workflows/test-integrations-dbs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
os: [ubuntu-22.04]
2222
services:
2323
postgres:
24-
image: postgres
24+
image: ghcr.io/getsentry/image-mirror-library-postgres:17-alpine
2525
env:
2626
POSTGRES_PASSWORD: sentry
2727
# Set health checks to wait until postgres has started

.github/workflows/test-integrations-tasks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
os: [ubuntu-22.04]
2222
services:
2323
redis:
24-
image: redis
24+
image: ghcr.io/getsentry/image-mirror-library-redis:7.0.8-bullseye
2525
options: >-
2626
--health-cmd "redis-cli ping"
2727
--health-interval 10s

.github/workflows/test-integrations-web-1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
os: [ubuntu-22.04]
2222
services:
2323
postgres:
24-
image: postgres
24+
image: ghcr.io/getsentry/image-mirror-library-postgres:17-alpine
2525
env:
2626
POSTGRES_PASSWORD: sentry
2727
# Set health checks to wait until postgres has started

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
include LICENSE
22
include sentry_sdk/py.typed
3+
graft tests

scripts/split_tox_gh_actions/templates/test_group.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{% endif %}
1818
{% if needs_postgres %}
1919
postgres:
20-
image: postgres
20+
image: ghcr.io/getsentry/image-mirror-library-postgres:17-alpine
2121
env:
2222
POSTGRES_PASSWORD: sentry
2323
# Set health checks to wait until postgres has started
@@ -32,7 +32,7 @@
3232
{% endif %}
3333
{% if needs_redis %}
3434
redis:
35-
image: redis
35+
image: ghcr.io/getsentry/image-mirror-library-redis:7.0.8-bullseye
3636
options: >-
3737
--health-cmd "redis-cli ping"
3838
--health-interval 10s

sentry_sdk/integrations/litestar.py

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -287,40 +287,37 @@ async def handle_wrapper(
287287

288288
request_data = await body
289289

290-
def event_processor(event: "Event", _: "Hint") -> "Event":
291-
route_handler = scope.get("route_handler")
290+
route_handler = scope.get("route_handler")
291+
292+
func = None
293+
if route_handler.name is not None:
294+
name = route_handler.name
295+
# Accounts for use of type `Ref` in earlier versions of litestar without the need to reference it as a type
296+
elif hasattr(route_handler.fn, "value"):
297+
func = route_handler.fn.value
298+
else:
299+
func = route_handler.fn
300+
if func is not None:
301+
name = transaction_from_function(func)
302+
303+
source = SOURCE_FOR_STYLE["endpoint"]
292304

305+
if not name:
306+
name = _DEFAULT_TRANSACTION_NAME
307+
source = TransactionSource.ROUTE
308+
309+
sentry_sdk.set_transaction_name(name, source)
310+
sentry_scope.set_transaction_name(name, source)
311+
312+
def event_processor(event: "Event", _: "Hint") -> "Event":
293313
request_info = event.get("request", {})
294314
request_info["content_length"] = len(scope.get("_body", b""))
295315
if should_send_default_pii():
296316
request_info["cookies"] = extracted_request_data["cookies"]
297317
if request_data is not None:
298318
request_info["data"] = request_data
299319

300-
func = None
301-
if route_handler.name is not None:
302-
tx_name = route_handler.name
303-
# Accounts for use of type `Ref` in earlier versions of litestar without the need to reference it as a type
304-
elif hasattr(route_handler.fn, "value"):
305-
func = route_handler.fn.value
306-
else:
307-
func = route_handler.fn
308-
if func is not None:
309-
tx_name = transaction_from_function(func)
310-
311-
tx_info = {"source": SOURCE_FOR_STYLE["endpoint"]}
312-
313-
if not tx_name:
314-
tx_name = _DEFAULT_TRANSACTION_NAME
315-
tx_info = {"source": TransactionSource.ROUTE}
316-
317-
event.update(
318-
{
319-
"request": deepcopy(request_info),
320-
"transaction": tx_name,
321-
"transaction_info": tx_info,
322-
}
323-
)
320+
event["request"] = deepcopy(request_info)
324321
return event
325322

326323
sentry_scope._name = LitestarIntegration.identifier

sentry_sdk/integrations/starlite.py

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -238,39 +238,36 @@ async def handle_wrapper(
238238

239239
request_data = await body
240240

241-
def event_processor(event: "Event", _: "Hint") -> "Event":
242-
route_handler = scope.get("route_handler")
241+
route_handler = scope.get("route_handler")
242+
243+
func = None
244+
if route_handler.name is not None:
245+
name = route_handler.name
246+
elif isinstance(route_handler.fn, Ref):
247+
func = route_handler.fn.value
248+
else:
249+
func = route_handler.fn
250+
if func is not None:
251+
name = transaction_from_function(func)
252+
253+
source = SOURCE_FOR_STYLE["endpoint"]
243254

255+
if not name:
256+
name = _DEFAULT_TRANSACTION_NAME
257+
source = TransactionSource.ROUTE
258+
259+
sentry_sdk.set_transaction_name(name, source)
260+
sentry_scope.set_transaction_name(name, source)
261+
262+
def event_processor(event: "Event", _: "Hint") -> "Event":
244263
request_info = event.get("request", {})
245264
request_info["content_length"] = len(scope.get("_body", b""))
246265
if should_send_default_pii():
247266
request_info["cookies"] = extracted_request_data["cookies"]
248267
if request_data is not None:
249268
request_info["data"] = request_data
250269

251-
func = None
252-
if route_handler.name is not None:
253-
tx_name = route_handler.name
254-
elif isinstance(route_handler.fn, Ref):
255-
func = route_handler.fn.value
256-
else:
257-
func = route_handler.fn
258-
if func is not None:
259-
tx_name = transaction_from_function(func)
260-
261-
tx_info = {"source": SOURCE_FOR_STYLE["endpoint"]}
262-
263-
if not tx_name:
264-
tx_name = _DEFAULT_TRANSACTION_NAME
265-
tx_info = {"source": TransactionSource.ROUTE}
266-
267-
event.update(
268-
{
269-
"request": deepcopy(request_info),
270-
"transaction": tx_name,
271-
"transaction_info": tx_info,
272-
}
273-
)
270+
event["request"] = deepcopy(request_info)
274271
return event
275272

276273
sentry_scope._name = StarliteIntegration.identifier

0 commit comments

Comments
 (0)