-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Introduce auto-generated equal methods for pdata structs #13285
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
base: main
Are you sure you want to change the base?
Introduce auto-generated equal methods for pdata structs #13285
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13285 +/- ##
==========================================
+ Coverage 91.60% 91.77% +0.17%
==========================================
Files 522 519 -3
Lines 29161 29584 +423
==========================================
+ Hits 26712 27150 +438
+ Misses 1932 1920 -12
+ Partials 517 514 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Do you know why this breaks the contrib tests? (that needs to be fixed).
The error was indeed caused by my changes, and I will fix it. |
755e20e
to
e82912a
Compare
@dmathieu I've fixed the contrib tests failure and tried to improve the code coverage. |
Please don't force-push PRs. That breaks the GitHub review process and forces to look at everything again. |
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.
cc @bogdandrutu
@@ -806,6 +836,17 @@ func (opv *optionalPrimitiveValue) GenerateCopyOrig(ms *messageValueStruct) stri | |||
return executeTemplate(t, opv.templateFields(ms)) | |||
} | |||
|
|||
func (opv *optionalPrimitiveValue) GenerateEqualComparison(*messageValueStruct) string { |
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.
Design question: I believe it will be useful to accept options to ignore some fields (not sure how to cleanly do that with nested object yet), a very good example is that lots of times we want to ignore timestamps when comparing metrics (potentially).
@open-telemetry/collector-approvers if you have any idea how to design this, please jump in and propose ideas.
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.
It sounds a good idea to have compare options in the interface, similar to e.g. go-cmp
Description
Introduce auto-generated equal methods for pdata structs.
Link to tracking issue
Implementation #13221
Testing
Documentation