Conversation
Add the Spanner data client to the allow-list. Also fixes an error when generating the code for the Type proto of Spanner. This proto has a direct recursive field `array_element_type`. This is generated as a boxed field, but the to_proto / from_proto methods did not take this into account.
There was a problem hiding this comment.
Code Review
This pull request correctly adds the Spanner data client to the allow-list. It also introduces a fix for generating code for recursive proto fields in Rust, specifically for types like Spanner's Type proto. A new MapToBoxed flag is added to field annotations to detect when prost will box a field due to recursion, and the to_proto conversion logic in the templates is updated to handle this correctly. The accompanying test updates are thorough and validate the new logic. I have one suggestion to improve the clarity of the mapToBoxed helper function's visited map initialization.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4072 +/- ##
=======================================
Coverage 81.93% 81.93%
=======================================
Files 78 78
Lines 6516 6516
=======================================
Hits 5339 5339
Misses 832 832
Partials 345 345 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
coryan
left a comment
There was a problem hiding this comment.
The code LGTM, but it would be nicer if we separated the allow list change from the sidekick changes. Do you mind doing so?
Sure, I'll split it into two changes. |
Add the Spanner data client to the allow-list.
Also fixes an error when generating the code for the Type proto of Spanner. This proto has a direct recursive field
array_element_type. This is generated as a boxed field, but the to_proto / from_proto methods did not take this into account.