Repository navigation
Conversation
parseWorkspacePath split on every colon and required exactly two parts, so remote paths with a colon (timestamped logs) were rejected and local paths with a colon were parsed as instance names. Split at the first colon and treat an argument as local when a "/" comes before the colon, as scp does. Fixes brevdev#537
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.
brev copyparsedinstance:pathwithstrings.Split(path, ":")and required exactly two parts. As a result a remote path containing a colon (for example a timestamped logmy-instance:/logs/run-12:30:00.log) was rejected withinvalid instance path format, and a local path with a colon after a/(./out/run-12:30.log) was taken as an instance named./out/run-12.This change splits at the first colon and, like scp, treats an argument as local when a
/appears before the colon. The remote path is still passed to rsync/scp asalias:path, which both split at the first colon, so paths with colons now transfer as expected. An argument without a colon, or with a leading:, is handled as before.parseWorkspacePathcan no longer fail, so it no longer returns an error. The oldTestParseWorkspacePath_InvalidMultipleColonstest asserted the rejection and is replaced by tests for a colon in the remote path and in the local path.Fixes #537
Testing
go test ./pkg/cmd/copy/passes;go vetandgofmt -lare clean.invalid instance path format, use instance_name:/pathandexactly one of source or destination must be an instance path.-Oand the default SFTP mode) passaliasas the host and keep/logs/run-12:30:00.logintact; an upload of./run-12:30.logalso connects toalias.This change was drafted with Claude Code (claude-opus-5-5); the test results above are from the runs described.