Fix bug in toolkit yaml version parsing#1595
Conversation
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. |
|
/gemini review |
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1595 +/- ##
==========================================
- Coverage 91.85% 91.83% -0.02%
==========================================
Files 126 130 +4
Lines 7468 7573 +105
==========================================
+ Hits 6860 6955 +95
- Misses 608 618 +10
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request updates the quote_int_value_by_key_in_yaml utility with a more robust regex to handle YAML key quoting and adds several test cases to verify that non-integer values remain unchanged. A suggestion was made to improve the regex by capturing the key and its trailing whitespace in the first group to preserve formatting and simplify the replacement string.
Description
Tighten
quote_int_value_by_key_in_yamlso it no longer uses([\d_]+)(.*)$, which only quoted the leading digit run and broke lines likeversion: 1.0by formating them likeversion: "1".0. This PR builds upon #1594 which was again based on the the existing handling in Toolkit, and retains the same-line#comment handling which was added while avoiding to malformat floats. Extra unit tests added to ensure we don't introduce changes to floats, semver-like text, scientific notation, and emptyversion:lines.Currently, the user would see the following error if the version contains periods:
Bump
Changelog
Fixed
1.0.0).