Skip to content

[do not merge] Testing merge - #8243

Merged
sentrivana merged 5 commits into
major/3.0from
ivana/major/test-merge-2
Nov 11, 2026
Merged

sentrivana merged 5 commits into
major/3.0from
ivana/major/test-merge-2

Conversation

@sentrivana

Copy link
Copy Markdown
Collaborator

No description provided.

sentrivana and others added 5 commits November 11, 2026 09:09
### Description

QoL improvement to make `--only`/`--skip` more useful.

Running `populate_tox.py` with `--only` (or `--skip`) wiped most of the
jsonl caches.

At the end of each run, both `releases.jsonl` and
`package_dependencies.jsonl` are rewritten to contain only entries that
were accessed during the run. Skipped integrations are read from the
existing `tox.ini` and never touch their `releases.jsonl` entries or
their free-threading dependency entries, so all of those got pruned.

Now unused entries are only pruned on full runs. Partial runs still sort
the files and add newly fetched entries, but don't drop anything. Stale
entries for the updated packages stick around until the next full run.
Update our test matrix with new releases of integrated frameworks and
libraries.

## How it works
- Scan PyPI for all supported releases of all frameworks we have a
dedicated test suite for.
- Pick a representative sample of releases to run our test suite
against. We always test the latest and oldest supported version.
- Update
[tox.ini](https://github.com/getsentry/sentry-python/blob/master/tox.ini)
with the new releases.

## Action required
- If CI passes on this PR, it's safe to approve and merge. It means our
integrations can handle new versions of frameworks that got pulled in.
- If CI doesn't pass on this PR, this points to an incompatibility of
either our integration or our test setup with a new version of a
framework.
- Check what the failures look like and either fix them, or update the
[test
config](https://github.com/getsentry/sentry-python/blob/master/scripts/populate_tox/config.py)
and rerun
[scripts/generate-test-files.sh](https://github.com/getsentry/sentry-python/blob/master/scripts/generate-test-files.sh).
See
[scripts/populate_tox/README.md](https://github.com/getsentry/sentry-python/blob/master/scripts/populate_tox/README.md)
for what configuration options are available.

 _____________________

_🤖 This PR was automatically created using [a GitHub
action](https://github.com/getsentry/sentry-python/blob/master/.github/workflows/update-tox.yml)._

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ivana Kellyer <ivana.kellyer@sentry.io>
…vocation (#8134)

### Description
Path-style handlers, e.g. `SENTRY_INITIAL_HANDLER=app/index.handler`,
were manually loaded and never cached unlike dotted handlers, e.g.
`index.handler` which automatically ended up in `sys.modules`; so module
was loaded again on every warm invocation and state was lost.

#### Changes & Results
Loader now does the same as [Lambda runtime
itself](https://github.com/aws/aws-lambda-python-runtime-interface-client/blob/fa2462d93d11da632aad8f8bfb07a3e060438150/awslambdaric/bootstrap.py#L53):
`/` is turned into `.` and `importlib.import(...)` is called; Python
caches the module, so it runs exactly once per execution environment.

Some results below on a Lambda function (python3.13, arm64, 512 MB) that
creates 3 boto3 clients at import:

<img width="1350" height="825" alt="warm-duration"
src="https://github.com/user-attachments/assets/167e6cd4-c6cf-45fa-9e8c-46c8aa56076a"
/>

Warm invocations: p50 122ms => 58ms; p99 180ms => 69ms.

<img width="1350" height="750" alt="cold-start"
src="https://github.com/user-attachments/assets/f4a0cfc3-ccdb-4919-a690-153b955da906"
/>

Cold starts remain the same, 1.4s for both.

<img width="1350" height="825" alt="memory"
src="https://github.com/user-attachments/assets/1edeb09d-b75a-4b35-a35d-9998637217bc"
/>

Peak memory also drops from 117 MB => 108 MB and is fixed on
invocations, unlike the old layer which grows over time because each
call creates new clients.


#### Issues
Resolves #8079 & PY-3016

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Ivana Kellyer <131587164+sentrivana@users.noreply.github.com>
Fixes clear-cut misspellings across comments, docstrings, script output,
and a few local or test-only identifiers. Found with `codespell` and
`typos`, and every hit was checked by hand.

Nothing public changes. The renamed identifiers are a local variable in
`sentry_sdk/utils.py` (`should_supress_context`), a local in
`scripts/find_raise_from_none.py`, a test-local variable, and three test
function names.

These were left alone on purpose:
- `dependant`: FastAPI's own API name
- `checkin`: Sentry crons terminology
- `deprecat`: regex prefix in `.github/release.yml`
- `need_code_loation`: old method name quoted in `MIGRATION_GUIDE.md`
- `baGGage`: tests that header matching ignores case
- Chunked test strings like `"hel"` and `"ons"`
- Typos in `CHANGELOG.md`, since those are historical release notes

<!-- junior-request-attribution:start -->
via @sentrivana.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0BTREZTS2Z%3A1794390864.677739 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0BTREZTS2Z%3A1794390864.677739)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0BTREZTS2Z%3A1794390864.677739/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Ivana Kellyer <131587164+sentrivana@users.noreply.github.com>
@sentrivana
sentrivana merged commit a112e2f into major/3.0 Nov 11, 2026
150 of 151 checks passed
@sentrivana
sentrivana deleted the ivana/major/test-merge-2 branch November 11, 2026 10:42
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 58057 passed | ❌ 1 failed | ⏭️ 3058 skipped | Total: 61116 | Pass Rate: 94.99% | Execution Time: 152m 20s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -85551
Passed Tests 📉 -80941
Failed Tests 📈 +1
Skipped Tests 📉 -4611

➕ New Tests (1)

View new tests
  • test_execution_outcome[describe_execution-FAILED-None]
    • File: tests.integrations.boto3.test_stepfunctions
    • Status: ❌ Failing

❌ Failed Tests

test_execution_outcome[describe_execution-FAILED-None]

File: tests.integrations.boto3.test_stepfunctions
Suite: py3.10-boto3-v1.44.0
Error: assert '4242' not in "{'trace_id': 'e900b84f01564008a719de819a8eef1d', 'span_id': '8dcbfbd982d7b95a', 'name': 'SFN.DescribeExecution', 'status': 'ok', 'is_segment': False, 'start_timestamp': 1794393483.004242, 'end_timestamp': 1794393483.00494, 'parent_span_id': '92195c2472605093', 'attributes': {'sentry.origin': 'auto.aws.boto3', 'sentry.trace_lifecycle': 'stream', 'cloud.provider': 'aws', 'rpc.method': 'DescribeExecution', 'rpc.system.name': 'aws-api', 'sentry.kind': 'client', 'rpc.service': '... [+5 more lines; full report in element text]

Stack Trace
tests/integrations/boto3/test_stepfunctions.py:152: in test_execution_outcome
    assert "4242" not in str(span)
E   assert '4242' not in "{'trace_id': 'e900b84f01564008a719de819a8eef1d', 'span_id': '8dcbfbd982d7b95a', 'name': 'SFN.DescribeExecution', 'status': 'ok', 'is_segment': False, 'start_timestamp': 1794393483.004242, 'end_timestamp': 1794393483.00494, 'parent_span_id': '92195c2472605093', 'attributes': {'sentry.origin': 'auto.aws.boto3', 'sentry.trace_lifecycle': 'stream', 'cloud.provider': 'aws', 'rpc.method': 'DescribeExecution', 'rpc.system.name': 'aws-api', 'sentry.kind': 'client', 'rpc.service': 'SFN', 'cloud.region': 'eu-north-1', 'server.address': 'states.eu-north-1.amazonaws.com', 'server.port': 443, 'aws.step_functions.execution.arn': 'arn:aws:states:eu-north-1:123456789012:execution:orders:order-1234', 'cloud.resource_id': 'arn:aws:states:eu-north-1:123456789012:execution:orders:order-1234', 'cloud.account.id': '123456789012', 'aws.step_functions.state_machine.name': 'orders', 'sentry.op': 'rpc', 'thread.id': '140432395321344', 'thread.name': 'MainThread', 'aws.step_functions.state_machine.arn': 'arn:aws:states:eu-north-1:123456789012:stateMachine:orders', 'sentry.segment.id': '92195c2472605093', 'sentry.segment.name': 'parent', 'sentry.sdk.name': 'sentry.python', 'sentry.sdk.version': '3.0.0b4', 'process.runtime.name': 'CPython', 'process.runtime.version': '3.10.12', 'sentry.environment': 'production', 'sentry.release': 'b8d5f057d8692a6a643da8c1ed1af0c1f1f54c4c'}}"
E     
E     '4242' is contained here:
E     ?                                                                                                                                                                                       ^
E       {'trace_id': 'e900b84f01564008a719de819a8eef1d', 'span_id': '8dcbfbd982d7b95a', 'name': 'SFN.DescribeExecution', 'status': 'ok', 'is_segment': False, 'start_timestamp': 1794393483.004242, 'end_timestamp': 1794393483.00494, 'parent_span_id': '92195c2472605093', 'attributes': {'sentry.origin': 'auto.aws.boto3', 'sentry.trace_lifecycle': 'stream', 'cloud.provider': 'aws', 'rpc.method': 'DescribeExecution', 'rpc.system.name': 'aws-api', 'sentry.kind': 'client', 'rpc.service': 'SFN', 'cloud.region': 'eu-north-1', 'server.address': 'states.eu-north-1.amazonaws.com', 'server.port': 443, 'aws.step_functions.execution.arn': 'arn:aws:states:eu-north-1:123456789012:execution:orders:order-1234', 'cloud.resource_id': 'arn:aws:states:eu-north-1:123456789012:execution:orders:order-1234', 'cloud.account.id': '123456789012', 'aws.step_functions.state_machine.name': 'orders', 'sentry.op': 'rpc', 'thread.id': '140432395321344', 'thread.name': 'MainThread', 'aws.step_functions.state_machine.arn': 'arn:aws:states:eu-north-1:123456789012:stateMachine:orders', 'sentry.segment.id': '92195c2472605093', 'sentry.segment.name': 'parent', 'sentry.sdk.name': 'sentry.python', 'sentry.sdk.version': '3.0.0b4', 'process.runtime.name': 'CPython', 'process.runtime.version': '3.10.12', 'sentry.environment': 'production', 'sentry.release': 'b8d5f057d8692a6a643da8c1ed1af0c1f1f54c4c'}}
E     ?                                                                                                                                                                                       ^^^^^

✅ Patch coverage is 100.00% (no changed executable lines found; target 80%).
Project statement coverage is 90.38% (up 0.11 percentage points from base (86b2e98) to head (a112e2f)).

Files with missing lines (5)
File Coverage % Lines
sentry_sdk/utils.py 92.33% ⚠️ 68 Missing and 34 partials
sentry_sdk/client.py 92.64% ⚠️ 37 Missing and 28 partials
sentry_sdk/integrations/starlette.py 90.60% ⚠️ 36 Missing and 22 partials
sentry_sdk/integrations/huggingface_hub.py 89.90% ⚠️ 21 Missing and 27 partials
sentry_sdk/integrations/django/signals_handlers.py 95.56% ⚠️ 2 Missing and 4 partials
Coverage diff
@@            Coverage Diff             @@
##        master     #8243       +/-##
==========================================
+ Coverage    90.27%    90.38%    +0.11%
==========================================
  Files          203       199        -4
  Tracked lines     27114     21598     -5516
  Branches     10136      7488     -2648
==========================================
- Hits         24475     19520     -4955
+ Misses        2639      2078      -561
+ Partials      1540      1253      -287

Generated by Coverage Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants