Skip to content

Conversation

@brianquinlan
Copy link
Contributor

No description provided.

@brianquinlan brianquinlan requested a review from a team as a code owner December 17, 2025 23:24
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @brianquinlan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a deserialization issue in the Dart code generation for maps that utilize integral types as keys. It introduces a specialized keyDecoder to accurately convert string-based integer keys from JSON into their corresponding Dart int types. This enhancement significantly improves the robustness and correctness of Dart deserialization for protobuf-generated code, particularly for complex data structures involving integer map keys.

Highlights

  • New keyDecoder function: A dedicated keyDecoder function has been introduced to specifically handle the deserialization logic for map keys, differentiating between string and various integral types.
  • Support for integral map keys: The system now correctly deserializes maps where keys are integral types (e.g., int32, int64) by converting their string representations from JSON back into Dart ints.
  • Improved error handling: The decoder function's default case has been updated to provide a more specific and informative panic message when encountering unsupported types during deserialization.
  • Enhanced test coverage: New test cases have been added to validate the correct deserialization of maps with int32 keys, ensuring the new functionality works as expected.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request fixes an issue with deserializing maps that have integer keys in Dart. The changes introduce a new keyDecoder function to handle specific decoding for map keys, which is a good approach. The implementation is supported by a new test case, ensuring the fix works as expected. My main feedback is to consider extending the keyDecoder to support all valid protobuf map key types for a more complete solution.

@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

❌ Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.28%. Comparing base (44216d1) to head (3c8b1e2).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
internal/sidekick/dart/annotate.go 70.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3285      +/-   ##
==========================================
- Coverage   80.29%   80.28%   -0.01%     
==========================================
  Files         162      162              
  Lines       13730    13737       +7     
==========================================
+ Hits        11024    11029       +5     
- Misses       2137     2139       +2     
  Partials      569      569              

☔ 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.

@brianquinlan brianquinlan merged commit efe2657 into googleapis:main Dec 18, 2025
10 checks passed
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.

3 participants