fix: preserve env config on capsule remove, add --purge flag#646
fix: preserve env config on capsule remove, add --purge flag#646joshuajbouw merged 3 commits intomainfrom
Conversation
Previously, 'astrid capsule remove' always deleted the env.json containing user configuration (API keys, secrets). This forced users to re-enter credentials on every reinstall. Now env.json is preserved by default. The install command already skips prompting when env.json exists, so reinstall is seamless. Use 'astrid capsule remove --purge' to explicitly delete saved configuration along with the capsule.
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 updates the capsule removal workflow to improve user experience by preventing unnecessary data loss. By default, environment configurations are now retained during removal, ensuring that users do not need to re-authenticate or re-enter credentials upon reinstalling a capsule. A new purge mechanism has been added to support scenarios where a complete removal of all associated data is required. 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. The config was lost in the fray, When capsules were taken away. But now with a flag, And no more to drag, The secrets are here to stay. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a --purge flag to the capsule removal command, allowing users to optionally delete environment configurations that were previously removed by default. Feedback was provided regarding the lack of automated tests for this new functionality, as required by the style guide, and the need for explicit error handling when deleting configuration files to prevent silent failures.
- Handle remove_file Result with context instead of silently ignoring - Add 3 tests: preserve without purge, delete with purge, no-op purge
Linked Issue
Closes #647
Summary
astrid capsule removewas unconditionally deleting the capsule'senv.json(API keys, secrets). This forced users to re-enter credentials on every reinstall cycle.Changes
remove.rs: env.json deletion moved behind--purgeflag (default: preserve)remove.rs:remove_fileerror now propagated with context instead of silently ignoredmain.rs: added--purgeCLI flag toCapsuleCommands::RemovepurgeparameterBefore:
remove→ deletes env.json →install→ prompts for config againAfter:
remove→ env.json preserved →install→ skips prompting, config reusedUse
astrid capsule remove --purgeto explicitly delete saved configuration.Test Plan
cargo test -p astrid— 153 tests pass (150 existing + 3 new)