fix(cli): kg rename-project cannot remove a project by accident - #546
Open
kevintseng wants to merge 2 commits into
Open
kevintseng wants to merge 2 commits into
kevintseng wants to merge 2 commits into
Conversation
Renaming a project to itself is refused; before, --apply removed the project from every memory. The --apply backup is written beside the database, includes changes still in the write-ahead log, and the dry run reports the same blocked message rows as the apply. Closes #519
…isions The dry run counts the message rows the apply would leave in place with a query instead of trying the writes, so it also works on a read-only database. Only a unique-key collision counts as left in place; any other write error aborts the whole rename with a one-line message. The dry run prints the count, and the restore command is quoted for any path.
This branch has not been deployed
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.
Refs #519.
kg rename-project --from X --to Xis refused with a one-line error (dry run and--apply). Before,--applyremoved the project tag from every memory of X.--applybacks up tobackups/beside the database (not./data/backups/under the current directory). The backup is a consistent copy that includes changes still in the write-ahead log, it is owner-only, and the printed restore command is quoted for any path.--apply, only a unique-key collision counts as left in place; any other write error rolls the whole rename back with a one-line message.Tests
New tests in
tests/core/project-tags.test.tsandtests/cli-agent-message-ingress.test.tscover each point; they fail on the previous code.npm run verify: green.