Skip to content

fix(cli): preserve existing directories during single-file upload - #4177

Open
shiju-nv wants to merge 2 commits into
NVIDIA:mainfrom
shiju-nv:fix/4175-upload-destinations
Open

shiju-nv wants to merge 2 commits into
NVIDIA:mainfrom
shiju-nv:fix/4175-upload-destinations

Conversation

@shiju-nv

@shiju-nv shiju-nv commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Uploading a single file to an existing directory now puts the file inside it, even without a trailing slash. Previously, the upload could report success after replacing an empty directory with the file. Missing destination paths still support intentional filename renames.

Related Issue

Closes #4175

Changes

  • Inspect the destination through the authenticated SSH session before choosing the archive entry name.
  • Preserve empty and nonempty directories, destination directory symlinks and source symlinks. Keep existing file overwrites, missing-path renames and Git-filtered placement unchanged.
  • Recheck the destination type before extraction and inspect it again on transport retries.
  • Print the resulting path after an unfiltered upload and explain the placement rules in CLI help and the sandbox docs.
  • Add shell-and-tar unit regressions and existing-directory cases to portable file-transfer conformance.

Testing

  • Checks appropriate to the affected code and behavior pass
  • Unit tests added/updated (if applicable)
  • E2E tests added/updated (if applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable): sandbox file-transfer docs and CLI help updated

Inspect remote destination types before choosing archive entry names.
Keep directory and source symlinks intact, recheck detected type changes,
and report the resulting path. Add real tar and live conformance coverage.

Closes NVIDIA#4175

Signed-off-by: Shiju <shiju@nvidia.com>
Use an if expression instead of initializing and reassigning the optional
destination guard. Preserve the existing probe, placement and error paths
while satisfying clippy::useless_let_if_seq in the PR checks.

Signed-off-by: Shiju <shiju@nvidia.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Single-file upload replaces an existing empty destination directory

1 participant