fix(core): revert auto-save of policies to user space#20531
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 addresses an issue where auto-saved tool approval policies were incorrectly stored in the workspace directory. The changes revert this behavior, ensuring policies are now saved to the user's global configuration directory. This simplifies policy management by centralizing auto-saved policies and prepares for the temporary disabling of workspace-specific policies. Highlights
Changelog
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 reverts the auto-save location for tool approval policies from the workspace directory to the global user directory. The changes in storage.ts and config.ts correctly implement this reversion by updating the path generation and ensuring the global directory is created. The corresponding tests in persistence.test.ts have been updated to reflect the new behavior. The implementation appears correct and aligns with the stated goal of the pull request.
|
Size Change: -104 B (0%) Total Size: 25.7 MB ℹ️ View Unchanged
|
Reverts the auto-save of tool approval policies from the workspace directory back to the global user space (~/.gemini/policies). This change is necessary as workspace policies are being temporarily disabled to simplify policy management. - Updated Storage.getAutoSavedPolicyPath to use getUserPoliciesDir. - Modified createPolicyUpdater to ensure the parent directory of the policy file is created before writing. - Updated persistence tests to reflect the change in storage location. Fixes: #20530 Refs: #20522
0777f06 to
678e663
Compare
|
/patch preview |
|
✅ Patch workflow(s) dispatched successfully! 📋 Details:
🔗 Track Progress: |
|
🚀 Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
|
🚀 Patch Release Started! 📋 Release Details:
⏳ Status: The patch release is now running. You'll receive another update when it completes. 🔗 Track Progress: |
|
✅ Patch Release Complete! 📦 Release Details:
🎉 Status: Your patch has been successfully released and published to npm! 📝 What's Available:
🔗 Links: |
Summary
Reverts the auto-save of tool approval policies from the workspace directory back to the global user space (~/.gemini/policies). This is necessary because workspace policies are being temporarily disabled to simplify policy management.
Details
Storage.getAutoSavedPolicyPathinpackages/core/src/config/storage.tsto usegetUserPoliciesDir().createPolicyUpdaterinpackages/core/src/policy/config.tsto ensure the parent directory of the policy file is created before writing. This handles cases where~/.gemini/policiesmight not exist.workspacePoliciesDir.Related Issues
Fixes #20530
Related to #20522
How to Validate
auto-saved.tomlis created in~/.gemini/policies/and NOT in the workspace's.gemini/policies/.npm test -w @google/gemini-cli-core -- src/policy/persistence.test.tsPre-Merge Checklist