Skip to content

feat(cli): import exact local Git revisions into sandboxes - #41

Merged
farhan-helmy merged 3 commits into
boxcompute:mainfrom
kyzer1023:feat/sandbox-git-import
Nov 30, 2026
Merged

farhan-helmy merged 3 commits into
boxcompute:mainfrom
kyzer1023:feat/sandbox-git-import

Conversation

@kyzer1023

@kyzer1023 kyzer1023 commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Local commits can be ready to test before they are pushed. bxc sandbox import-git SANDBOX_ID . HEAD /workspace/project takes the selected commit and its reachable history from a local checkout, including repositories without a remote.

The command uploads a Git pack in 8 MiB chunks using the existing sandbox API. It verifies the pack and the checked-out commit, then moves the detached checkout into place with overwrite disabled. Working-tree changes, Git configuration, credential helpers, and remotes stay local.

How it was tested

  • Bun 1.3.14 typecheck, lint, build, and 117 Linux tests passed. All nine focused Git import tests passed on Windows.
  • Synthetic Git fixtures covered a tag, a private repository without a remote, an unpublished merge, a pack over 8 MiB, incomplete history, and transfer, destination, and cleanup failures.
  • Go 1.27.1 native checks, npm pack --dry-run, and installed CLI smoke tests on Node 20, 22, and 24 passed.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

farhan-helmy
farhan-helmy previously approved these changes Nov 30, 2026

@farhan-helmy farhan-helmy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, this is careful work:

  • --end-of-options guards the revision.
  • Git is found only in absolute PATH directories.
  • Git in the VM runs with a clean environment.
  • The pack passes a SHA-256 check before index-pack, and a connectivity check before checkout.
  • Nothing is deleted recursively when the rename is uncertain.

The tests run the real restore script against Git, and the API's file rename and mkdir support what it needs. CI passes.

Before merge: please rebase for the CHANGELOG.md and package.json conflicts. 0.17.0 assumes #38 and #40 land first.

Bring in 0.14.3. The 0.17.0 changelog entry sits above it and the
package keeps 0.17.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
farhan-helmy
farhan-helmy previously approved these changes Nov 30, 2026

@farhan-helmy farhan-helmy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I merged main into this branch to bring in 0.14.3 (no force push). The only conflicts were in CHANGELOG.md and package.json. Your 0.17.0 entry now sits above 0.14.3, and the package keeps 0.17.0. The rest of the diff is unchanged, and CI passes, including the Windows job from #37. Re-approving, since the push dismissed my earlier review.

No action needed from you. I'll update the changelog again as the earlier PRs land.

Bring in 0.14.4, 0.15.0 and 0.16.0. The 0.17.0 changelog entry sits
above them and the package keeps 0.17.0. The README keeps both new
sections: the 0.16.0 operation guide, then Git import.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@farhan-helmy
farhan-helmy merged commit 4d5fe84 into boxcompute:main Nov 30, 2026
6 checks passed
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.

2 participants