-
Notifications
You must be signed in to change notification settings - Fork 213
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
feat: Attachments support #670
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #670 +/- ##
==========================================
+ Coverage 80.59% 80.62% +0.02%
==========================================
Files 43 44 +1
Lines 4407 4459 +52
==========================================
+ Hits 3552 3595 +43
- Misses 726 732 +6
- Partials 129 132 +3
☔ View full report in Codecov by Sentry. |
Nice, thank you @edigaryev! |
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.
Looking good, just one ask about test coverage 👍
@@ -94,6 +94,38 @@ func getRequestBodyFromEvent(event *Event) []byte { | |||
return nil | |||
} | |||
|
|||
func encodeAttachment(enc *json.Encoder, b io.Writer, attachment *Attachment) error { |
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.
Please add a test in transport_test.go
that tests this function.
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.
PTAL at 52caef2.
Not sure if testing encodeAttachment()
directly makes sense in the presence of tests like TestEnvelopeFromErrorBody
, which will already call that function under the hood if we set event.attachments
to something.
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.
What you added is actually what I had in mind.
Fair point, but if we treat attachments as a separate "feature" of the SDK, having a separate test for that sounds like a good thing to me.
Thanks @edigaryev 🎉 |
The attachments support is now released as part of https://github.com/getsentry/sentry-go/releases/tag/v0.23.0 👍 |
This is similar to how
sentry-rust
supports attachments.Resolves #574.