Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

minimAluminiumalism
Copy link

@minimAluminiumalism minimAluminiumalism commented Jun 28, 2025

Description

Introduce auto-generated equal methods for pdata structs.

Link to tracking issue

Implementation #13221

Testing

Documentation

@minimAluminiumalism minimAluminiumalism changed the title introduce auto-generated equal methods for pdata structs Introduce auto-generated equal methods for pdata structs Jun 28, 2025
Copy link

codecov bot commented Jun 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.77%. Comparing base (ef18746) to head (739b65b).
Report is 6 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@dmathieu dmathieu left a 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).

@minimAluminiumalism
Copy link
Author

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.

@minimAluminiumalism
Copy link
Author

@dmathieu I've fixed the contrib tests failure and tried to improve the code coverage.

@dmathieu
Copy link
Member

Please don't force-push PRs. That breaks the GitHub review process and forces to look at everything again.

Copy link
Member

@dmathieu dmathieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -806,6 +836,17 @@ func (opv *optionalPrimitiveValue) GenerateCopyOrig(ms *messageValueStruct) stri
return executeTemplate(t, opv.templateFields(ms))
}

func (opv *optionalPrimitiveValue) GenerateEqualComparison(*messageValueStruct) string {
Copy link
Member

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.

Copy link
Member

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

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.

4 participants