fix(update): check version exists before confirming uninstall#4774
Open
euxaristia wants to merge 1 commit intoclockworklabs:masterfrom
Open
fix(update): check version exists before confirming uninstall#4774euxaristia wants to merge 1 commit intoclockworklabs:masterfrom
euxaristia wants to merge 1 commit intoclockworklabs:masterfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Collaborator
|
Hi @euxaristia, thanks for opening a PR. Is there a reason for the changes in |
Author
|
Sorry that was mistakenly included. I think I made a separate PR for those changes already. I'll remove the bindings noise from this PR soon. |
Previously, `spacetime version uninstall <ver>` would show a y/N
confirmation prompt even when the version wasn't installed, then fail
with a cryptic "No such file or directory (os error 2)" after the user
confirmed.
Now the command checks if the version directory exists before prompting,
and returns a clear error: "v{ver} is not installed".
Added 4 unit tests covering:
- Nonexistent version errors before prompt
- Current version cannot be uninstalled
- "current" keyword cannot be uninstalled
- Successful uninstall removes the version directory
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
f700e85 to
bbdc3b7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevents
spacetime version uninstall <ver>from showing a confirmation prompt when the version isn't installed, which previously resulted in a cryptic "No such file or directory (os error 2)" error after the user confirmed.Changes
Bug fix
v{version} is not installedTests (4 unit tests)
test_uninstall_nonexistent_version_errors_before_prompt— confirms error fires before prompt for missing versionstest_uninstall_current_version_errors— confirms you can't uninstall the active versiontest_uninstall_current_keyword_errors— confirms the literal string "current" is rejectedtest_uninstall_existing_version_with_yes— confirms normal uninstall flow worksVerification
Reproduction
Before this fix:
After this fix: