Skip to content

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

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

shiju-nv wants to merge 1 commit 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

@johntmyers johntmyers added the test:e2e Requires end-to-end coverage label Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Label test:e2e applied for 67b0f80. Open the existing run and click Re-run all jobs to execute with the label set. The run will execute the standard E2E suite after building the required gateway, sandbox, and supervisor images once. The matching required CI gate status on this PR will flip green automatically once the run finishes.

@johntmyers johntmyers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

PR Review Status

The initial review found no blocking issues in the upload destination fix. The existing CI gates pass, and the standard E2E suite is now queued for this head after applying test:e2e and rerunning the workflow as instructed by E2E Label Help.

Blocking findings: None.

Carried findings: None.

Gator metadata
  • Validation: Focused fix for the reproducible single-file upload bug in #4175.
  • Docs: Published sandbox documentation and CLI help explain destination placement.
  • Checks: DCO, Branch Checks, Helm Lint, and Trivy Changes pass on the current head.
  • E2E: test:e2e applied; Branch E2E Checks run 37198134708, attempt 2, confirmed queued.
  • Head SHA: 67b0f8024477411a0ce7eadcca711c40846f8abb
  • Base SHA: 71c3cd957abef062eb7f37010056717cd49f2ed3
  • Merge base SHA: 71c3cd957abef062eb7f37010056717cd49f2ed3
  • Patch ID: f9a4959b6b75ca9c0f89635e2590fcb1b0a0c74b
  • Gator payload: 10
  • Review mode: initial
  • Previous reviewed SHA: none
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:watch-pipeline

@johntmyers johntmyers added gator:watch-pipeline Gator is monitoring PR CI/CD status gator:approval-needed Gator completed review; maintainer approval needed and removed gator:watch-pipeline Gator is monitoring PR CI/CD status labels Oct 5, 2026
johntmyers
johntmyers previously approved these changes Oct 6, 2026
@johntmyers
johntmyers added this pull request to the merge queue Oct 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 6, 2026
@johntmyers johntmyers added gator:merge-ready and removed gator:approval-needed Gator completed review; maintainer approval needed labels Oct 6, 2026
@johntmyers
johntmyers added this pull request to the merge queue Oct 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 6, 2026
@johntmyers johntmyers added gator:blocked Gator is blocked by process or repository gates and removed gator:merge-ready labels Oct 6, 2026
@johntmyers

Copy link
Copy Markdown
Collaborator

@shiju-nv this will need a rebase etc

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>

@johntmyers johntmyers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

PR Review Status

Thanks @johntmyers for flagging the rebase. I checked the updated head against the prior reviewed patch, isolated the author changes from upstream changes, and confirmed the upload reporting still works with the new shared planning helper. The independent follow-up review found no new blocking issues, and GitHub reports the head is mergeable.

Branch Checks and the standard E2E suite are running on the current head. Gator will monitor their results before handing this to a maintainer for approval.

Blocking findings: None.

Carried findings: None.

Gator metadata
  • Validation: Focused single-file upload destination fix for #4175.
  • Docs: Published sandbox docs and CLI help describe destination placement.
  • Checks: DCO, Helm Lint, and Trivy Changes pass; Branch Checks are pending.
  • E2E: test:e2e retained; current-head Branch E2E Checks run 37581339905 is in progress, attempt 1. No additional dispatch is needed.
  • Head SHA: 9b368eed43c74e2be61dbc7e998a38f35b0b7908
  • Base SHA: 834b79a8c2351370e7c6c363423f5be18d440256
  • Merge base SHA: 834b79a8c2351370e7c6c363423f5be18d440256
  • Patch ID: 02746674f19bdf554a7f3808c22f469f7618eb66
  • Gator payload: 10
  • Review mode: follow_up
  • Previous reviewed SHA: 67b0f8024477411a0ce7eadcca711c40846f8abb
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:watch-pipeline

@johntmyers johntmyers added gator:watch-pipeline Gator is monitoring PR CI/CD status gator:in-review Gator is reviewing or awaiting PR review feedback and removed gator:blocked Gator is blocked by process or repository gates gator:watch-pipeline Gator is monitoring PR CI/CD status labels Oct 7, 2026

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

gator:in-review Gator is reviewing or awaiting PR review feedback test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Single-file upload replaces an existing empty destination directory

2 participants