sentry-python icon indicating copy to clipboard operation
sentry-python copied to clipboard

Django support sensitive variables

Open vagi8 opened this issue 2 years ago • 15 comments

Fix #2356

  • Added support for sensitive_variables and sensitive_post_parameter decorators.
  • Added test cases

vagi8 avatar Sep 29 '23 09:09 vagi8

Future Task: Django version 5.0 is expected to support coroutine functions as well. This PR does not add support for it. I will deal with it in a separate PR.

vagi8 avatar Sep 29 '23 09:09 vagi8

I did check out this error earlier and I was hoping I could get some help resolving. This is an error in test setup, where django is not able to get the view for the route (as shown in the image). The same works in my local (using pytest command for latest django version as well). All views are present (to the best of my knowledge). Tox test case pass for django-v1.11 and below.

Could you help me why the test environment is not able to identify the route ?

image

vagi8 avatar Oct 24 '23 18:10 vagi8

Hey @vagi8. Could you try removing/commenting out this test https://github.com/getsentry/sentry-python/blob/master/tests/integrations/django/test_basic.py#L1057 and seeing if the problem persists? I found out in an unrelated PR that that test may be altering the urlconf for other tests, leading to failures. I'll see if I can fix that in another PR.

sentrivana avatar Oct 25 '23 09:10 sentrivana

@sentrivana
All test cases pass when I comment out the said test case. Verified with django-v2.2 and django-v4.1

vagi8 avatar Oct 25 '23 09:10 vagi8

@vagi8 Thanks for verifying! I've pushed a small commit to your PR to address the broken test case.

sentrivana avatar Oct 25 '23 09:10 sentrivana

@vagi8 Can you please take a look at these?

  • the Django Python 2.7 tests are failing: https://github.com/getsentry/sentry-python/actions/runs/6638956405/job/18036359266?pr=2399
  • mypy complaining in the lint step: https://github.com/getsentry/sentry-python/actions/runs/6638956425/job/18036360400?pr=2399

sentrivana avatar Oct 25 '23 10:10 sentrivana

@sentrivana hey,

The error is because python2.7 gives out a unicode variable.

The past few hours I have been trying to setup the py2.7 environment locally and it is a pain. Not sure if i did setup correctly, when I run pytest on django i get this error and cant seem to resolve it.

tests/integrations/django/test_basic.py:28: in from sentry_sdk.integrations.executing import ExecutingIntegration sentry_sdk/integrations/executing.py:17: in raise DidNotEnable("executing is not installed") E DidNotEnable: executing is not installed

tox -e py2.7-django-v1.8 has similar error.

vagi8 avatar Oct 26 '23 09:10 vagi8

Hey @szokeasaurusrex, Thank you for being patient on the PR. Thanks for the feedback. I resolved everything.

vagi8 avatar Mar 04 '24 15:03 vagi8

How are we on this @vagi8 ? Is there some time or motivation to bring this over the finish line?

antonpirker avatar Jun 27 '24 09:06 antonpirker

@antonpirker little busy but I can try to spend some time. Any deadline ? We Django 5 released as well so I might have to add support for coroutines too.

vagi8 avatar Jun 27 '24 15:06 vagi8

We do not have deadlines :-)

antonpirker avatar Jul 18 '24 11:07 antonpirker

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

getsantry[bot] avatar Aug 09 '24 07:08 getsantry[bot]