-
Notifications
You must be signed in to change notification settings - Fork 10
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
Chore: enrich sentry debugging #302
base: main
Are you sure you want to change the base?
Conversation
store invalid import files for later debugging
@@ -38,6 +38,7 @@ def fetch_for_account(account) | |||
|
|||
vmk_data = account.transport_client.VMK(safe_from.to_s(:db), safe_to.to_s(:db)) | |||
return unless vmk_data | |||
vmk_data = vmk_data.encode(vmk_data.encoding, universal_newline: true) |
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 seems kinda weird updating the variable itself instead of having a decoded_vmk_data or something similar. How did this work before? Does it not need to be encoded?
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.
Ah yes this can be named something else.
In short this ensures we have universal newlines and not some windows newlines as those create problems in the cmxl parser.
Any ideas for a name 😅
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.
Ah because vmk_data is just a string? Maybe just something like
vmk_data = vmk_data.encode(vmk_data.encoding, universal_newline: true) | |
vmk_data = account | |
.transport_client.VMK(safe_from.to_s(:db), safe_to.to_s(:db)) | |
&.encode(vmk_data.encoding, universal_newline: true) # converting windows newlines | |
return unless vmk_data |
vmk_data = account.transport_client.VMK(safe_from.to_s(:db), safe_to.to_s(:db)) | ||
return unless vmk_data | ||
vmk_data = vmk_data.encode(vmk_data.encoding, universal_newline: true) |
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.
vmk_data = account.transport_client.VMK(safe_from.to_s(:db), safe_to.to_s(:db)) | |
return unless vmk_data | |
vmk_data = vmk_data.encode(vmk_data.encoding, universal_newline: true) | |
vmk_data = account | |
.transport_client.VMK(safe_from.to_s(:db), safe_to.to_s(:db)) | |
&.then { it.encode(it.encoding, universal_newline: true) } | |
return unless vmk_data |
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.
Honestly you can also just leave it as you did but add a comment. I thought it was encoding some bank data structures or something
What changes are introduced?
upload invalid import files to sentry
Why are these changes introduced?
Have invalid import files in sentry next to the exception data for better error debugging
How are these changes made?
use sentry
add_attachment
featureHow was it tested? (optional)
remove this section, when you don't add further information
Some code, especially infrastructure code (say HELM or Kubernetes yaml files) are harder to test. So it’s important to let the reviewer know how you tested them in case you can’t check in tests. Alternatively, you can explain to the reviewer how to test it locally if necessary. Showing the results of tests you’ve run in this section if none are visible in the diff is also very helpful.