feat(config): support string coercion for boolean settings#25634
feat(config): support string coercion for boolean settings#25634midnight-wonderer wants to merge 1 commit intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello, 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 enables support for boolean settings provided as strings within the configuration. This change facilitates better integration with environment variable interpolation, ensuring that configuration values are correctly parsed even when passed as strings. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request implements boolean coercion for configuration settings, allowing "true" and "false" strings to be validated as booleans. Feedback suggests enhancing the robustness of this logic by supporting case-insensitivity and whitespace trimming to better support environment variables, along with corresponding test updates.
This PR is intentionally kept minimal by addressing two related issues at once:
Solution: Aligning with People's Expectations
This PR simply aligns the code with these expectations. I suggest @gemini-code-assist to discuss from the points I laid out, or probably human to override its suggestion. |
|
Thank you for the clarification, @midnight-wonderer. I understand the design goal here is to maintain a minimal footprint while ensuring that environment variable interpolation behaves intuitively by treating string-based 'true' and 'false' values as their boolean counterparts. Given that this aligns with the expected behavior for configuration settings in this context, I agree that this approach is appropriate and avoids unnecessary complexity. The implementation looks solid. |
Summary
This solve #25573 . It allow boolean input as strings, so that environment variable interpolation works.
Details
I asked Gemini-CLI to modify itself. The code looks okay to me.
Related Issues
Fixes #25573
How to Validate
You could run the tests, or try the
settings.jsonfield in #25573Pre-Merge Checklist