Repository navigation
fix: keep sanitized project paths inside the workspace - #789
Open
pcbeingused333 wants to merge 1 commit into
Open
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
A path component made only of forbidden characters, spaces or periods sanitized to an empty string. As the first component that made the local path absolute, so cloud push failed with ValueError. Name such components "_" and skip empty components between separators. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Fixes #776
Root cause:
_format_local_pathreplaces forbidden characters with spaces, then strips spaces and trailing periods from each component, so a component such as:,or..could become empty. For:/Strategythe result was/Strategy; joining that toPath.cwd()discards the workspace, andcloud pushthen raisedValueErrorfromrelative_to. A name that sanitized to nothing entirely resolved to the workspace directory itself.Fix: a component that sanitizes to an empty string is named
_, so:/Strategybecomes_/Strategy(the issue allows a usable local name or a validation error; this takes the first). Empty components from leading, trailing or repeated separators are skipped, which also keeps a leading/from making the path absolute.Tests: a parametrized test for
get_local_project_pathcovers these names; five of its six cases fail before the change (the trailing separator case guards existing behaviour).tests/components/util,tests/components/cloudandtests/commands/cloudpass. The reproduction from the issue, followed byrename_project_and_contents, now moves the project to_/Strategyinside the workspace.This change was prepared with AI assistance.