Skip to content

fix(cli): honor filenames for Git-filtered uploads - #6099

Merged
shiju-nv merged 5 commits into
mainfrom
fix/1740-git-aware-single-file-upload/shiju-nv
Dec 2, 2026
Merged

shiju-nv merged 5 commits into
mainfrom
fix/1740-git-aware-single-file-upload/shiju-nv

Conversation

@shiju-nv

Copy link
Copy Markdown
Collaborator

Summary

Uploading one file from a Git work tree now puts it at the requested filename in the sandbox. Git still checks which paths can be uploaded. The CLI then uses the existing single-file destination rules, including placing the file inside an existing directory.

Related Issue

Closes #1740. Thanks to @rh-dnagornuks for the earlier implementation and regression test in the fork PR.

Changes

  • Pass a regular file selected by Git through the existing single-file upload path for both sandbox upload and sandbox create --upload.
  • Match the supplied path literally in Git. Ignore deeper index entries when a regular file replaces a tracked directory. Keep Git's filename normalization on macOS.
  • Update the existing conformance scenario to upload a tracked file under a different name and verify the contents at that filename. Update the CLI help and sandbox guide.

Release Notes

Single-file uploads from a Git work tree respect an explicit destination filename and report the resulting path. Existing destination directories receive the file under its original name.

Testing

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

Checklist

Signed-off-by: Shiju <shiju@nvidia.com>
@github-actions github-actions Bot added the state:accepted A maintainer decided OpenShell should pursue this issue label Nov 30, 2026
@github-actions

Copy link
Copy Markdown

@shiju-nv shiju-nv added area:platform SDKs, CLIs, APIs, gateway infrastructure, persistence, configuration, and session management. test:e2e Requires end-to-end coverage topic:ux CLI commands/flags, help, errors/exit codes, human-readable output, TUI, and first-run experience. labels Nov 30, 2026

@gator-review-bot gator-review-bot Bot left a comment

Copy link
Copy Markdown

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 code review found one blocking regression in Git-filtered upload planning. Required CI and the selected E2E suite passed on this head.

Action required: Keep literal matching enabled and prevent inherited Git pathspec settings from breaking the upload.

Blocking findings:

  • GATOR-14675e81-01: Inherited Git glob or case-insensitive pathspec settings cause both upload entry points to fail during planning. See the inline finding for the fix and test.

Carried findings:

  • None

Non-blocking suggestions:

  • Add planner coverage for literal filenames containing brackets and for an ignored regular file that replaces an indexed directory.
Gator metadata
  • Validation: Concentrated CLI fix for #1740. PR issue acceptance passed.
  • Docs: The sandbox guide and CLI help describe single-file destination behavior. The guide is already in the Fern navigation.
  • Checks: DCO, Branch Checks, Helm Lint, and Trivy Changes passed on this head.
  • E2E: The selected test:e2e suite passed on this head.
  • Head SHA: 14675e8149db0cb9f03ed3d8b9573df98a0f2f2a
  • Base SHA: 967c594c311007bc74969666502efa348a0ff41d
  • Merge base SHA: 967c594c311007bc74969666502efa348a0ff41d
  • Patch ID: 1866641083c7fda740039eafd43edda05ff2634a
  • Gator payload: 19
  • Review mode: initial
  • Previous reviewed SHA: none
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:in-review

Comment thread crates/openshell-cli/src/run.rs Resolved
@gator-review-bot gator-review-bot Bot added the gator:in-review Gator is reviewing or awaiting PR review feedback label Dec 1, 2026
Signed-off-by: Shiju <shiju@nvidia.com>

@gator-review-bot gator-review-bot Bot left a comment

Copy link
Copy Markdown

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

Shiju, I checked your fix for inherited Git settings. Both upload commands share the updated planner, and the regression test covers each setting while checking that ignored files are still excluded. I resolved the original thread. The follow-up found one macOS regression in how the planner chooses the local file to read.

Action required: Keep the caller’s source path separate from Git’s normalized filename.

Blocking findings:

  • GATOR-7521a98f-01: On a normalization-sensitive macOS mount, Git’s normalized filename can cause an upload to read a different local file.

Carried findings:

  • None
Gator metadata
  • Validation: Concentrated CLI fix for #1740. PR Issue Acceptance passed.
  • Docs: The existing Fern sandbox guide and CLI help describe the changed upload behavior. The guide is already in the Fern navigation.
  • Checks: DCO, Helm Lint, and Trivy Changes passed. Branch Checks is running.
  • E2E: The selected test:e2e suite is running on this head.
  • Head SHA: 7521a98fee1d4eac0c929e53a38c06005941566f
  • Base SHA: 967c594c311007bc74969666502efa348a0ff41d
  • Merge base SHA: 967c594c311007bc74969666502efa348a0ff41d
  • Patch ID: 48f1718a8c5f3f233bc2ffb42751132e2ce77fbf
  • Gator payload: 19
  • Review mode: follow_up
  • Previous reviewed SHA: 14675e8149db0cb9f03ed3d8b9573df98a0f2f2a
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:in-review

Comment thread crates/openshell-cli/src/run.rs Resolved
Signed-off-by: Shiju <shiju@nvidia.com>

@gator-review-bot gator-review-bot Bot left a comment

Copy link
Copy Markdown

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

Shiju, I checked the source-path change in both upload commands. They now read the requested file and keep Git’s normalized name for the archive. On macOS, an outstanding case remains where Git can select one file while the uploader reads a different, ignored file.

Action required: Verify Git eligibility for the exact local file before uploading it.

Blocking findings:

  • GATOR-18db771c-01 — A Git match for a different file can let an ignored file into the upload.

Carried findings:

  • GATOR-7521a98f-01 — The fix preserves source identity. The original thread remains open while the filtering regression introduced by the fix is addressed in the new finding.
Gator metadata
  • Validation: Concentrated CLI fix for #1740. PR Issue Acceptance passed.
  • Docs: The existing Fern sandbox guide and CLI help cover single-file destination behavior.
  • Checks: DCO, Helm Lint, and Trivy Changes passed. Branch Checks is pending.
  • E2E: The selected test:e2e suite is queued for this head.
  • Head SHA: 18db771c42cfa1eed775b32f6e7edfbe99f87d2c
  • Base SHA: 967c594c311007bc74969666502efa348a0ff41d
  • Merge base SHA: 967c594c311007bc74969666502efa348a0ff41d
  • Patch ID: abb8389dec6223273c7898f052c9c8ccb46849e2
  • Gator payload: 19
  • Review mode: follow_up
  • Previous reviewed SHA: 7521a98fee1d4eac0c929e53a38c06005941566f
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:in-review

Comment thread crates/openshell-cli/src/run.rs Resolved
Signed-off-by: Shiju <shiju@nvidia.com>

@gator-review-bot gator-review-bot Bot left a comment

Copy link
Copy Markdown

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

Both upload commands now read the requested local file. When Git’s normalized path names a different entry, the planner checks the exact source before upload and keeps Git’s normalized archive name for eligible files. I verified both fixes and resolved their threads.

Blocking findings:

  • No blocking findings remain.

Carried findings:

  • None
Gator metadata
  • Validation: Concentrated CLI fix for #1740. PR Issue Acceptance passed.
  • Docs: The CLI help and existing Fern sandbox guide cover single-file destination behavior.
  • Checks: DCO, Helm Lint, and Trivy Changes passed. Branch Checks is pending.
  • E2E: The existing test:e2e label selected an E2E run, which is pending on this head.
  • Head SHA: 79285560c7f0564e93f7c80f53a8d97e0ac44d3a
  • Base SHA: 967c594c311007bc74969666502efa348a0ff41d
  • Merge base SHA: 967c594c311007bc74969666502efa348a0ff41d
  • Patch ID: de9e56f4bafc6aa66040c4f01b80c3ceae48d309
  • Gator payload: 19
  • Review mode: critical_only
  • Previous reviewed SHA: 18db771c42cfa1eed775b32f6e7edfbe99f87d2c
  • Review budget exhausted: yes
  • Maintainer decision required: no
  • Next state: gator:watch-pipeline

@gator-review-bot gator-review-bot Bot added gator:watch-pipeline Gator is monitoring PR CI/CD status and removed gator:in-review Gator is reviewing or awaiting PR review feedback labels Dec 2, 2026
Signed-off-by: Shiju <shiju@nvidia.com>
@gator-review-bot

Copy link
Copy Markdown

gator-agent

Maintainer Approval Needed

Gator review is complete. The latest update kept the reviewed patch intact, and all Gator review threads are resolved. DCO, Branch Checks, Helm Lint, Trivy Changes, and the selected E2E suite passed on the current head.

Action required: A maintainer needs to review and approve the PR.

Gator metadata

@gator-review-bot gator-review-bot Bot added gator:approval-needed Gator completed review; maintainer approval needed and removed gator:watch-pipeline Gator is monitoring PR CI/CD status labels Dec 2, 2026
@shiju-nv
shiju-nv enabled auto-merge December 2, 2026 18:45
@gator-review-bot gator-review-bot Bot added gator:merge-ready and removed gator:approval-needed Gator completed review; maintainer approval needed labels Dec 2, 2026
@shiju-nv
shiju-nv added this pull request to the merge queue Dec 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 2, 2026
@shiju-nv
shiju-nv added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit fd4f86d Dec 2, 2026
448 of 458 checks passed
@shiju-nv
shiju-nv deleted the fix/1740-git-aware-single-file-upload/shiju-nv branch December 2, 2026 20:01
@gator-review-bot

Copy link
Copy Markdown

gator-agent

Monitoring Complete

Monitoring is complete because this PR merged.

Final status: Gator review was complete, required checks and the selected E2E suite passed, and maintainer approval was present.

I removed the active gator:merge-ready label because there is nothing left for Gator to monitor.

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

Labels

area:platform SDKs, CLIs, APIs, gateway infrastructure, persistence, configuration, and session management. state:accepted A maintainer decided OpenShell should pursue this issue test:e2e Requires end-to-end coverage topic:ux CLI commands/flags, help, errors/exit codes, human-readable output, TUI, and first-run experience.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sandbox upload creates a directory instead of a file when source is inside a git repository

2 participants