fix(dart): enums referenced outside the package#2952
fix(dart): enums referenced outside the package#2952brianquinlan merged 4 commits intogoogleapis:mainfrom
Conversation
Fixes a bug where enums referenced from a package other than the current one did not have a package prefix.
Summary of ChangesHello @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 critical bug in the Dart code generation process where enums originating from packages other than the current one were not being correctly prefixed, resulting in compilation errors. The solution involves a clear separation of concerns by introducing a specialized function for resolving enum names, which now correctly applies package prefixes. The existing function for resolving message names has also been renamed for better clarity. Comprehensive test cases have been added to ensure the robustness of these changes for both local and cross-package type references. Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request effectively addresses a bug concerning the incorrect handling of enums referenced from external packages by introducing a dedicated resolveEnumName function. The related refactoring of resolveTypeName to resolveMessageName improves code clarity. The accompanying test additions are thorough, validating the fix for both enums and messages from foreign packages. I have one minor suggestion to improve the clarity of a test function's name.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2952 +/- ##
==========================================
+ Coverage 83.32% 83.38% +0.05%
==========================================
Files 134 134
Lines 10987 10990 +3
==========================================
+ Hits 9155 9164 +9
+ Misses 1414 1409 -5
+ Partials 418 417 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Brian Quinlan <[email protected]>
PR created by the Librarian CLI to initialize a release. Merging this PR will auto trigger a release. Librarian Version: not available Language Image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian-release-container:latest <details><summary>librarian: 0.7.0</summary> ## [0.7.0](v0.6.0...v0.7.0) (2025-11-20) ### Features * add command execution package with logging (#2968) ([12f4e94](12f4e949)) * add branch support to RepositoryConfig (#2906) ([2cab5d6](2cab5d65)) * add image sha as a config in repositories config (#2954) ([3d1f537](3d1f5375)) * add initial config (#2965) ([502b063](502b063c)) * add fetch package (#2964) ([53de44d](53de44d8)) * parse gapic_metadata for API version release notes (#2815) ([7ee0328](7ee03283)) * onboard 25 repositories to automation for publish-release (#2907) ([87fae04](87fae04a)) * add version command (#2894) ([8f85be0](8f85be09)) * add RequireCommand test helper (#2978) ([a820a71](a820a710)) * add initial command (#2961) ([c959aea](c959aeae)) * add `stage-release` command (#2902) ([ee05006](ee050065)) ### Bug Fixes * require git v2.28.0 (#2963) ([265ee47](265ee47f)) * enums referenced outside the package (#2952) ([7331816](73318169)) </details>
Fixes a bug where enums referenced from a package other than the current one did not have a package prefix.