Skip to content
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

If any messages do not have a subfilter then don't introspect them. #40

Merged
merged 4 commits into from
Jan 19, 2024

Conversation

artificial-aidan
Copy link
Contributor

@artificial-aidan artificial-aidan commented Jan 12, 2024

Allows for unknown anys to be mapped. The current default behavior will always try and unmarshal protobuf any messages, which can cause an issue if the contained message is not in the descriptor pool. This adds an option to only map into any messages if their is a subfield in the mask, which allows copying of an any message as a whole from struct to struct

Allows for unknown anys to be mapped

Signed-off-by: Aidan Jensen <aidan@artificial.com>
@artificial-aidan
Copy link
Contributor Author

I was thinking this might need an option, as it is technically breaking existing behavior, even if it is just erroring on fewer things.

Set to true to maintain backwards compatibility

Signed-off-by: Aidan Jensen <aidan@artificial.com>
Copy link
Owner

@mennanov mennanov left a comment

Choose a reason for hiding this comment

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

Could you please explain the benefits of not introspecting the unknown Any fields in the PR description?
Thanks!

copy_proto_test.go Outdated Show resolved Hide resolved
Signed-off-by: Aidan Jensen <aidan@artificial.com>
Copy link
Owner

@mennanov mennanov left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

Copy link

codecov bot commented Jan 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (88c57d8) 86.72% compared to head (6457ef3) 88.16%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #40      +/-   ##
==========================================
+ Coverage   86.72%   88.16%   +1.44%     
==========================================
  Files           2        2              
  Lines         482      490       +8     
==========================================
+ Hits          418      432      +14     
+ Misses         46       42       -4     
+ Partials       18       16       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

copy_proto_test.go Outdated Show resolved Hide resolved
@mennanov mennanov merged commit 6a34660 into mennanov:master Jan 19, 2024
12 checks passed
@mennanov
Copy link
Owner

Thanks for contributing!

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.

2 participants