Leave a leading tilde for the remote shell to expand - #54
Merged
Conversation
0.1.40 created a sync destination's parent with `mkdir -p`, but quoted the whole path. The remote shell then read '~/www/app/web' literally, so mkdir made a directory actually named "~" and the transfer still failed on the path it was meant to have created. The server grew a ./~/www/preview-462--alloayiti/web tree while the deploy reported the original error — 0.1.40 fixed nothing in practice. The unit test asserted on /x/web, an absolute path: the one shape where quoting the whole thing is harmless, and not the shape a deploy uses. A unit test and an integration test now both use a `~` path, and each was verified to fail without the fix, reproducing the same "No such file or directory". Co-authored-by: Claude <claude@anthropic.com> Claude-Session: https://claude.ai/code/session_016xdQPh3UcnZfjM5HS36ABP
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #54 +/- ##
==========================================
+ Coverage 82.30% 82.35% +0.04%
==========================================
Files 35 35
Lines 1481 1485 +4
Branches 375 377 +2
==========================================
+ Hits 1219 1223 +4
Misses 219 219
Partials 43 43
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
0.1.40 created a sync destination's parent with
mkdir -p, but quoted the whole path. The remote shell then read'~/www/app/web'literally, somkdirmade a directory actually named~and the transfer still failed on the path it was meant to have created:Meanwhile the deploy reported the original error, unchanged. 0.1.40 fixed nothing in practice — the retried pipeline failed identically, which is how this surfaced.
Why the test missed it
The unit test asserted on
/x/web:An absolute path is the one shape where quoting the whole thing is harmless — and not the shape a deploy uses. Every real call passes
~/www/<project>/…, because that is what--projects-dirdefaults to.The fix
A leading
~stays outside the quotes, so the shell expands it while the rest is still protected:~user/wwwanda~bare quoted whole: the first is a different expansion, the second is not one at all.Tests
Both a unit test and an integration test now use a
~path, and each was verified to fail without the fix, reproducing the samechange_dir "/home/testuser/trafic-test-tilde/web" failed: No such file or directory. The integration test also asserts no./~is left behind. 121 unit tests, 15 integration.