fix(internal/librarian): test logic should look for service and message/enums separately#2809
Conversation
…ge/enums separately
Summary of ChangesHello @zhumin8, 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 refines the testing framework for proto file generation by introducing a more sophisticated mechanism for detecting and validating changes. Previously, the test might have missed certain modifications within a proto file if it only registered a single change. The updated logic now independently identifies and tracks changes to both services and messages/enums, ensuring that the generated code accurately reflects all relevant modifications in the source proto files. This enhancement directly addresses issue #2623, leading to more robust and reliable generation tests. 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
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request effectively improves the test coverage for proto file generation by separately tracking changes for services and messages/enums. The logic is sound, and the changes are well-implemented across both the main logic and the test files. The introduction of new test cases for service-only and message-only protos is a great addition. I have one suggestion to make the code slightly more idiomatic, but overall this is a solid improvement.
There was a problem hiding this comment.
Code Review
This pull request correctly implements the logic to inject separate test GUIDs for services and messages/enums in proto files, which improves test coverage. The changes are logical and the tests have been updated accordingly to cover the new functionality. I have one suggestion to refactor a new helper function to improve code clarity and maintainability by reducing side effects.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2809 +/- ##
==========================================
+ Coverage 86.50% 86.80% +0.30%
==========================================
Files 120 120
Lines 10232 10574 +342
==========================================
+ Hits 8851 9179 +328
- Misses 977 989 +12
- Partials 404 406 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
With this change, the test now tracks services separately from messages/enums in proto files and provides more coverage.
Instead of only tracking a comment change for the first found message/enum/service, it now tracks a first service and first message/enum if both are present in the proto file.
Fix #2623