-
Notifications
You must be signed in to change notification settings - Fork 0
Preserve unmanaged env vars across claudio_save_env calls #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of ChangesHello @claudio-pi, 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 introduces a crucial improvement to how environment variables are managed within the system. It ensures that any custom, unmanaged environment variables set by the user are retained across configuration updates, thereby preventing unintended data loss and improving the robustness of the system's configuration handling. The change specifically targets the Highlights
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly implements the preservation of unmanaged environment variables in claudio_save_env, preventing accidental data loss when configuration is updated. The approach of identifying managed keys and preserving everything else is sound. I've added one suggestion to refine the implementation to also preserve user-added comments and blank lines, which improves the user experience and prevents loss of contextual information in the environment file, aligning with our guidelines on preserving user settings in configuration files.
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a mechanism to preserve unmanaged environment variables, comments, and blank lines in service.env when claudio_save_env is executed. The implementation correctly reads the existing file, filters out managed variables, and appends the remaining content back after writing the managed variables. This is a good improvement to prevent accidental data loss during updates or reinstalls.
I have one suggestion to simplify the logic for filtering lines, which will improve code clarity and maintainability.
claudio_save_env previously overwrote the entire service.env with only its hardcoded list of managed variables, silently deleting any extra vars (like HASS_TOKEN, ALEXA_SKILL_ID) that were added manually or by other integrations. Now it reads and preserves unmanaged variables.
Also filter only managed key assignments; keep all other content (comments, blank lines, custom variables) intact.
The pattern ^(PORT|MODEL|...)= already excludes empty lines and comments, so the explicit checks for those are redundant.
6f6467d to
e6e43f0
Compare
Summary
claudio_save_envnow reads existing unmanaged variables (e.g.HASS_TOKEN,ALEXA_SKILL_ID) before rewritingservice.env, and re-appends them at the endTest plan
~/.claudio/service.env(e.g.HASS_TOKEN="test")claudio reinstallor updateservice.env