Repository navigation
chore(sdk): deprecate the sandbox git module - #1774
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
🦋 Changeset detectedLatest commit: d687a8b The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Package ArtifactsBuilt from 4cad58a. Download artifacts from this workflow run. JS SDK ( npm install ./e2b-2.46.1-devin-1787827896-deprecate-git-module.0.tgzCLI ( npm install ./e2b-cli-2.18.1-devin-1787827896-deprecate-git-module.0.tgzCode Interpreter JS SDK ( npm install ./e2b-code-interpreter-2.7.2-devin-1787827896-deprecate-git-module.0.tgzDesktop JS SDK ( npm install ./e2b-desktop-2.3.3-devin-1787827896-deprecate-git-module.0.tgzPython SDK ( pip install ./e2b-2.46.0+devin.1787827896.deprecate.git.module-py3-none-any.whlCode Interpreter Python SDK ( pip install ./e2b_code_interpreter-2.9.1+devin.1787827896.deprecate.git.module-py3-none-any.whlDesktop Python SDK ( pip install ./e2b_desktop-2.4.3+devin.1787827896.deprecate.git.module-py3-none-any.whl |
There was a problem hiding this comment.
TASTE.md review of the deprecation annotations.
Checked: T-65/T-66/T-67/T-68 (deprecation and compatibility), T-1/T-2 (JS ↔ sync/async Python parity of the deprecated surface), T-69–T-74 (docstrings/JSDoc), T-54 (entry-point exports still intact).
1 violation (one issue, repeated across every Python site).
T-66: Python deprecations must use the :deprecated: docstring field, not the .. deprecated:: Sphinx directive. Same fix applies to the sites I didn't anchor individually: packages/python-sdk/e2b/exceptions.py (GitUpstreamException), packages/python-sdk/e2b/sandbox/_git/types.py (GitFileStatus, GitStatus, GitBranches), packages/python-sdk/e2b/sandbox_sync/git.py, packages/python-sdk/e2b/sandbox_async/git.py, and packages/python-sdk/e2b/sandbox_async/main.py (git property — keep it identical to the sync one for T-1/T-2 parity). The existing SDK convention matches the rule (beta_pause in sandbox_sync/main.py, get_httpx_transport in api/client_sync/__init__.py); note exceptions.py already had one pre-existing .. deprecated:: block, which is what this PR followed.
Everything else looks compliant: JS uses @deprecated with migration path + removal horizon (T-66), nothing is removed from the public surface (T-65), the JS and Python deprecated sets and wording mirror each other (T-1), and no beta-prefix or renaming concerns apply (T-67/T-68).
Not tied to a changed line: dropping the "Run git operations" bullet from the Sandbox class docs removes the only class-level mention of a module that still works for a whole major version — consider keeping the bullet with a "(deprecated)" marker instead, so the strike-through comes from the annotation rather than from missing docs (T-69).
| .. deprecated:: | ||
| The sandbox git module is deprecated and will be removed in the next major | ||
| version. Run git commands with ``sandbox.commands.run()`` instead. |
There was a problem hiding this comment.
T-66 — Python deprecations are marked with the :deprecated: docstring field, not the .. deprecated:: directive (T-71: reST field style is the Python docstring convention here; cf. beta_pause in sandbox_sync/main.py and get_httpx_transport in api/client_sync/__init__.py).
| .. deprecated:: | |
| The sandbox git module is deprecated and will be removed in the next major | |
| version. Run git commands with ``sandbox.commands.run()`` instead. | |
| :deprecated: The sandbox git module is deprecated and will be removed in the next | |
| major version. Run git commands with ``sandbox.commands.run()`` instead. |
| .. deprecated:: | ||
| The sandbox git module is deprecated and will be removed in the next major | ||
| version. Run git commands with ``sandbox.commands.run()`` instead. |
There was a problem hiding this comment.
T-66 — use the :deprecated: field here too, so the note renders alongside :param:/:return: fields like every other deprecation in the SDK.
| .. deprecated:: | |
| The sandbox git module is deprecated and will be removed in the next major | |
| version. Run git commands with ``sandbox.commands.run()`` instead. | |
| :deprecated: The sandbox git module is deprecated and will be removed in the next | |
| major version. Run git commands with ``sandbox.commands.run()`` instead. |
|
|
||
| .. deprecated:: | ||
| The sandbox git module is deprecated and will be removed in the next major | ||
| version. Run git commands with ``sandbox.commands.run()`` instead. |
There was a problem hiding this comment.
T-66 — :deprecated: field instead of the directive; matches beta_pause further down this same file. Apply the identical text to the git property in sandbox_async/main.py so the two mirrors stay character-for-character equal (T-1/T-2).
| .. deprecated:: | |
| The sandbox git module is deprecated and will be removed in the next major | |
| version. Run git commands with ``sandbox.commands.run()`` instead. | |
| :deprecated: The sandbox git module is deprecated and will be removed in the | |
| next major version. Run git commands with ``sandbox.commands.run()`` instead. |
|
please fix the format |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b786da139
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Reformatted in d687a8b: the deprecation notes are now single-line, matching the existing style — |
## Summary #1774 deprecated `Sandbox.git`, the `Git` class and its types, but not the individual methods. This adds the same deprecation notice to all 19 public `Git` methods (`clone`, `init`, `remoteAdd`, `remoteGet`, `status`, `branches`, `createBranch`, `checkoutBranch`, `deleteBranch`, `add`, `commit`, `reset`, `restore`, `push`, `pull`, `setConfig`, `getConfig`, `dangerouslyAuthenticate`, `configureUser`, and their snake_case Python equivalents): - JS: `@deprecated` JSDoc - Python sync + async: `:deprecated:` docstring line (same convention as the rest of the SDK) Annotations only, no behavior change; `patch` changeset. Migration: ```ts // before await sandbox.git.clone('https://github.com/e2b-dev/E2B', { path: '/home/user/E2B' }) // after await sandbox.commands.run('git clone https://github.com/e2b-dev/E2B /home/user/E2B') ``` Link to Devin session: https://app.devin.ai/sessions/c1ed439c560c461db1fbaa3669a2c2d7 Open in Devin Desktop: https://app.devin.ai/desktop/session/c1ed439c560c461db1fbaa3669a2c2d7?variant=devin Requested by: @mishushakov <!-- devin-review-badge-begin --> --- 🟢 Devin Review found nothing to fix · [View findings](https://app.devin.ai/review/e2b-dev/e2b/pull/2177) <a href="https://app.devin.ai/review/e2b-dev/e2b/pull/2177" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a><!-- devin-review-badge-end --> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: [email protected] <[email protected]>


Summary
Marks the sandbox git integration as deprecated in both SDKs. Behavior is unchanged — this is annotations only (
@deprecatedJSDoc in JS,.. deprecated::docstrings in Python), so IDEs strike through usage and users get a migration hint pointing at the commands module. Removal is planned for the next major.Closes SDK-366 (https://linear.app/e2b/issue/SDK-366/deprecate-the-sandbox-git-module-in-the-e2b-sdks)
Deprecated surface:
Sandbox.git, theGitclass, allGit*Opts/GitStatus/GitBranches/GitFileStatus/GitStatusLabel/GitConfigScope/GitResetModetypes, andGitAuthError/GitUpstreamErrorSandbox.gitandAsyncSandbox.git, bothGitclasses,GitStatus/GitFileStatus/GitBranches/GitResetMode, andGitAuthException/GitUpstreamExceptionAlso drops the "Run git operations" bullet from the JS
Sandboxclass docs.Migration:
Link to Devin session: https://app.devin.ai/sessions/669334a1f6834e6bb9a3e588ac7a05de
Open in Devin Desktop: https://app.devin.ai/desktop/session/669334a1f6834e6bb9a3e588ac7a05de?variant=devin
Requested by: @mishushakov