Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose :value in SingleExceptionInterface #2072

Merged
merged 2 commits into from
Jul 27, 2023
Merged

Expose :value in SingleExceptionInterface #2072

merged 2 commits into from
Jul 27, 2023

Conversation

jeffwidman
Copy link
Contributor

Expose :value in SingleExceptionInterface for users wishing to do basic sanitization of the exception message string in before_send().

For example, the :dependabot: project does basic sanitization of :value using sentry-raven:
https://github.com/dependabot/dependabot-core/blob/65f1c2d24e88ac57ed8df980871446deb5ea2d94/updater/lib/dependabot/sentry.rb#L21

So exposing this makes the migration path easier for those users. And makes it possible for anyone else to do basic redaction of potential secrets, etc.

Fix #2071

Expose `:value` in `SingleExceptionInterface` for users wishing to do
basic sanitization of the exception message string in `before_send()`.

For example, the :dependabot: project does basic sanitization of `:value`
using `sentry-raven`:
https://github.com/dependabot/dependabot-core/blob/65f1c2d24e88ac57ed8df980871446deb5ea2d94/updater/lib/dependabot/sentry.rb#L21

So exposing this makes the migration path easier for those users. And
makes it possible for anyone else to do basic redaction of potential
secrets, etc.

Fix #2071
@jeffwidman
Copy link
Contributor Author

I should caveat this PR with a note that I'm relatively new to Ruby, so if the goal is reasonable but the implementation is lacking, please point me in the right direction.

@codecov
Copy link

codecov bot commented Jul 16, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02% 🎉

Comparison is base (7764384) 83.23% compared to head (8f69bd3) 83.25%.

❗ Current head 8f69bd3 differs from pull request most recent head 4c086b0. Consider uploading reports for the commit 4c086b0 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2072      +/-   ##
==========================================
+ Coverage   83.23%   83.25%   +0.02%     
==========================================
  Files         119      119              
  Lines        5665     5666       +1     
==========================================
+ Hits         4715     4717       +2     
+ Misses        950      949       -1     
Files Changed Coverage Δ
...try-ruby/lib/sentry/interfaces/single_exception.rb 65.71% <100.00%> (+1.00%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sl0thentr0py sl0thentr0py merged commit 94a4895 into getsentry:master Jul 27, 2023
@jeffwidman
Copy link
Contributor Author

Awesome thanks for merging!

@jeffwidman jeffwidman deleted the allow-mutating-individual-exception-value branch July 27, 2023 16:55
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.

Expose :value in SingleExceptionInterface
2 participants