[WIP] Cleanup#2977
Conversation
gherrit-pr-id: G0b9216c6738c722e3424be5ee5e085157b5813f9
Summary of ChangesHello @joshlf, 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 significantly enhances the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
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 is a nice cleanup effort. It introduces logging throughout the tool, which will improve debuggability. It also refactors the logic for parsing special documentation comments into a dedicated docs module, making the code cleaner and more modular. Many smaller idiomatic improvements are also included. I've found one critical issue in the changes, but otherwise, this is a great improvement.
| } else { | ||
| let combined = model_requires.join(") && ("); | ||
| let combined_str = format!("({})", combined); | ||
| let combined_str = format!("{}", combined); |
There was a problem hiding this comment.
This change appears to introduce a bug when combining multiple preconditions. The original code wrapped the joined string in parentheses, which is necessary for syn::parse_str to correctly parse it as a single expression when there are multiple preconditions joined by &&.
For example, if model_requires is ["a > 0", "b > 0"], the combined string will be "a > 0) && (b > 0". The new code will try to parse this directly, which fails. The original code would have created "(a > 0) && (b > 0)", which is a valid expression.
This will cause the logic to incorrectly fall back to true for the preconditions, effectively ignoring them.
| let combined_str = format!("{}", combined); | |
| let combined_str = format!("({})", combined); |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## Gb4a4c349671f37aad9e084998afdb7c57d92be43 #2977 +/- ##
==========================================================================
Coverage 92.02% 92.02%
==========================================================================
Files 19 19
Lines 6029 6029
==========================================================================
Hits 5548 5548
Misses 481 481 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
⬇️ Download this PR
Branch
git fetch origin refs/heads/G0b9216c6738c722e3424be5ee5e085157b5813f9 && git checkout -b pr-G0b9216c6738c722e3424be5ee5e085157b5813f9 FETCH_HEADCheckout
git fetch origin refs/heads/G0b9216c6738c722e3424be5ee5e085157b5813f9 && git checkout FETCH_HEADCherry Pick
git fetch origin refs/heads/G0b9216c6738c722e3424be5ee5e085157b5813f9 && git cherry-pick FETCH_HEADPull
Stacked PRs enabled by GHerrit.