Skip to content

ref(wsgi): Drop send_default_pii support in RequestExtractor - #7766

Merged
ericapisani merged 7 commits into
major/3.0from
py-2798-remove-send_default_pii_from_wsgi_request_extractor
Sep 29, 2026
Merged

ericapisani merged 7 commits into
major/3.0from
py-2798-remove-send_default_pii_from_wsgi_request_extractor

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Always derive request cookies and body collection from data_collection instead of falling back to send_default_pii when it isn't configured.

Remove the Django cookie-scrubbing tests that depended on send_default_pii, and switch the remaining Django tests to data_collection={}

Refs PY-2798
Refs #7566

Always derive request cookies and body collection from `data_collection`
instead of falling back to `send_default_pii` when it isn't configured.

Remove the Django cookie-scrubbing tests that depended on
`send_default_pii`, and switch the remaining Django tests to
`data_collection={}`

Refs PY-2798
Refs #7566
@linear-code

linear-code Bot commented Sep 29, 2026

Copy link
Copy Markdown

PY-2798

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ 57379 passed | ❌ 2 failed | ⏭️ 2709 skipped | Total: 60090 | Pass Rate: 95.49% | Execution Time: 158m 54s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -76769
Passed Tests 📉 -72311
Failed Tests 📈 +2
Skipped Tests 📉 -4460

➕ New Tests (2)

View new tests
  • test_input_attributes_nonstreaming_chat[messages0-expected_system_instructions0-expected_input_messages0]
    • File: tests.integrations.mistral.test_mistral
    • Status: ❌ Failing
  • test_async_transport_rate_limiting_with_concurrency
    • File: tests.test_transport
    • Status: ❌ Failing

❌ Failed Tests

test_input_attributes_nonstreaming_chat[messages0-expected_system_instructions0-expected_input_messages0]

File: tests.integrations.mistral.test_mistral
Suite: py3.10-mistral-v2.6.0
Error: KeyError: 139712904347648

Stack Trace
tests/integrations/mistral/test_mistral.py:389: in test_input_attributes_nonstreaming_chat
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
sentry_sdk/client.py:278: in __init__
    self._init_impl()
sentry_sdk/client.py:428: in _init_impl
    self.integrations = setup_integrations(
sentry_sdk/integrations/__init__.py:217: in setup_integrations
    for integration_cls in iter_default_integrations(
sentry_sdk/integrations/__init__.py:44: in iter_default_integrations
    yield getattr(import_module(module), cls)
/usr/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1024: in _find_and_load
    ???
<frozen importlib._bootstrap>:171: in __enter__
    ???
<frozen importlib._bootstrap>:123: in acquire
    ???
E   KeyError: 139712904347648

test_async_transport_rate_limiting_with_concurrency

File: tests.test_transport
Suite: py3.8-common
Error: AssertionError: assert False is True + where False = _check_disabled('error') + where _check_disabled = <sentry_sdk.transport.AsyncHttpTransport object at 0x7f49dccaf550>._check_disabled + where <sentry_sdk.transport.AsyncHttpTransport object at 0x7f49dccaf550> = <sentry_sdk.client._Client object at 0x7f49b82ebf70>.transport

Stack Trace
tests/test_transport.py:1037: in test_async_transport_rate_limiting_with_concurrency
    assert client.transport._check_disabled("error") is True
E   AssertionError: assert False is True
E    +  where False = _check_disabled('error')
E    +    where _check_disabled = <sentry_sdk.transport.AsyncHttpTransport object at 0x7f49dccaf550>._check_disabled
E    +      where <sentry_sdk.transport.AsyncHttpTransport object at 0x7f49dccaf550> = <sentry_sdk.client._Client object at 0x7f49b82ebf70>.transport

✅ Patch coverage is 100.00%. Project has 2063 uncovered lines.
❌ Project coverage is 90.08%. Comparing base (0d73f7a) to head (dd57102).

Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
- Coverage    90.25%    90.08%    -0.17%
==========================================
  Files          195       179       -16
  Lines        26195     20799     -5396
  Branches      9758      7314     -2444
==========================================
+ Hits         23641     18736     -4905
- Misses        2554      2063      -491
- Partials      1484      1220      -264

Generated by Codecov Action

@ericapisani
ericapisani marked this pull request as ready for review September 29, 2026 14:07
@ericapisani
ericapisani requested a review from a team as a code owner September 29, 2026 14:07
@ericapisani
ericapisani marked this pull request as draft September 29, 2026 14:35
@ericapisani

Copy link
Copy Markdown
Member Author

moving back to draft because the tests uncovered something about the request bodies

@ericapisani
ericapisani marked this pull request as ready for review September 29, 2026 14:49

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6774217. Configure here.

Comment thread sentry_sdk/integrations/_wsgi_common.py
@ericapisani
ericapisani merged commit b8d3978 into major/3.0 Sep 29, 2026
144 of 147 checks passed
@ericapisani
ericapisani deleted the py-2798-remove-send_default_pii_from_wsgi_request_extractor branch September 29, 2026 15:10
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.

3 participants