-
Notifications
You must be signed in to change notification settings - Fork 26
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
Consolidating ErrorTracker methods into single method call (SCP-3378) #1046
Conversation
Codecov Report
@@ Coverage Diff @@
## development #1046 +/- ##
===============================================
+ Coverage 64.85% 65.09% +0.23%
===============================================
Files 181 181
Lines 16505 16425 -80
Branches 601 601
===============================================
- Hits 10705 10692 -13
+ Misses 5608 5541 -67
Partials 192 192
|
There appears to be an intermittent issue with precompiling static assets in sprockets 4 - on rare occasions a segfault is thrown. This is apparently a known issue: rails/sprockets#633. We should keep an eye on this as it could happen in any of our deployed environments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great! Couple nits -- I'm not sure I understand why in some cases you kept .to_unsafe_hash, and in others you removed it. And then just a method naming preference that could go either way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Following up on our recent discussion about straggling unnecessary#{Time.zone.now}:
prefixes in error messages, below I've removed the 43 cases here and tweaked remaining message content accordingly.
That feedback can be trivially applied via "Add suggestion to batch" and "Commit suggestions".
Co-authored-by: Eric Weitz <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I wouldn't be averse to yet another round of consolidation where the ErrorTracker also handles writing the log message. But that's a very-low-importance task for another day.
This update consolidates the usage of
ErrorTracker
for reporting errors to Sentry into a single method call ofreport_exception_with_context
, removing the need to callformat_extra_context
before reporting each exception. The new merged method will take any number of "context objects", being instances of models, request parameters, or any other object. This makes using the module easier and still reports necessary context along with errors.TO TEST:
As we do not report exceptions in development/test mode, the simplest way to test this is by invoking the method directly:
development.log
:This PR satisfies SCP-3378.