Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .changeset/remove-beta-pause.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
'e2b': minor
'@e2b/python-sdk': minor
Comment on lines +2 to +3

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Publish removed SDK methods as a major release

This changeset publishes the SDK removals as minor, but the diff deletes public methods Sandbox.betaPause and Sandbox.beta_pause; consumers using normal ^2.x ranges would receive this update and hit runtime/type errors when existing code still calls the deprecated aliases. Since the change deliberately removes public API, it needs a major bump (or the aliases need to remain until a major release) to avoid breaking minor-version installs.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

they were deprecated for some time now

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.

still a breaking change; should be major release (shouldn't be breaking changes from a minor release)

---

Remove `Sandbox.betaPause` (JS) and `Sandbox.beta_pause` (Python). These were deprecated aliases of `pause`. Migrate by calling `pause` instead:

```ts
// before
await sandbox.betaPause()
// after
await sandbox.pause()
```

```python
# before
sandbox.beta_pause()
# after
sandbox.pause()
```
2 changes: 1 addition & 1 deletion packages/cli/src/commands/sandbox/pause.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { NotFoundError } from 'e2b'

async function pauseSandbox(sandboxID: string, apiKey: string) {
try {
const paused = await e2b.Sandbox.betaPause(sandboxID, { apiKey })
const paused = await e2b.Sandbox.pause(sandboxID, { apiKey })
if (paused) {
console.log(`Sandbox ${asBold(sandboxID)} has been paused`)
} else {
Expand Down
9 changes: 1 addition & 8 deletions packages/js-sdk/src/sandbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ export class Sandbox extends SandboxApi {
* @example
* ```ts
* const sandbox = await Sandbox.create()
* await sandbox.betaPause()
* await sandbox.pause()
*
* // Connect to the same sandbox.
* const sameSandbox = await sandbox.connect()
Expand Down Expand Up @@ -534,13 +534,6 @@ export class Sandbox extends SandboxApi {
return await SandboxApi.pause(this.sandboxId, this.resolveApiOpts(opts))
}

/**
* @deprecated Use {@link Sandbox.pause} instead.
*/
async betaPause(opts?: ConnectionOpts): Promise<boolean> {
return await SandboxApi.betaPause(this.sandboxId, this.resolveApiOpts(opts))
}

/**
* Create a snapshot of the sandbox's current state.
*
Expand Down
10 changes: 0 additions & 10 deletions packages/js-sdk/src/sandbox/sandboxApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -922,16 +922,6 @@ export class SandboxApi {
return true
}

/**
* @deprecated Use {@link SandboxApi.pause} instead.
*/
static async betaPause(
sandboxId: string,
opts?: SandboxApiOpts
): Promise<boolean> {
return this.pause(sandboxId, opts)
}

/**
* Create a snapshot from a sandbox.
*
Expand Down
16 changes: 8 additions & 8 deletions packages/js-sdk/tests/api/list.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ sandboxTest.skipIf(isDebug)(
async ({ sandboxTestId }) => {
// Create and pause a sandbox
const extraSbx = await Sandbox.create({ metadata: { sandboxTestId } })
await extraSbx.betaPause()
await extraSbx.pause()

try {
const paginator = Sandbox.list({
Expand Down Expand Up @@ -125,11 +125,11 @@ sandboxTest.skipIf(isDebug)(
sandboxTest.skipIf(isDebug)(
'paginate paused sandboxes',
async ({ sandbox, sandboxTestId }) => {
await sandbox.betaPause()
await sandbox.pause()

// Create extra paused sandbox
const extraSbx = await Sandbox.create({ metadata: { sandboxTestId } })
await extraSbx.betaPause()
await extraSbx.pause()

try {
// Test pagination with limit
Expand Down Expand Up @@ -168,7 +168,7 @@ sandboxTest.skipIf(isDebug)(
const extraSbx = await Sandbox.create({ metadata: { sandboxTestId } })

// Pause the extra sandbox
await extraSbx.betaPause()
await extraSbx.pause()

try {
// Test pagination with limit
Expand Down Expand Up @@ -282,7 +282,7 @@ sandboxTest.skipIf(isDebug)(
async ({ sandboxTestId }) => {
// Create and pause a sandbox
const extraSbx = await Sandbox.create({ metadata: { sandboxTestId } })
await Sandbox.betaPause(extraSbx.sandboxId)
await Sandbox.pause(extraSbx.sandboxId)

try {
const paginator = Sandbox.list({
Expand Down Expand Up @@ -342,11 +342,11 @@ sandboxTest.skipIf(isDebug)(
sandboxTest.skipIf(isDebug)(
'paginate paused sandboxes',
async ({ sandbox, sandboxTestId }) => {
await Sandbox.betaPause(sandbox.sandboxId)
await Sandbox.pause(sandbox.sandboxId)

// Create extra paused sandbox
const extraSbx = await Sandbox.create({ metadata: { sandboxTestId } })
await Sandbox.betaPause(extraSbx.sandboxId)
await Sandbox.pause(extraSbx.sandboxId)

try {
// Test pagination with limit
Expand Down Expand Up @@ -385,7 +385,7 @@ sandboxTest.skipIf(isDebug)(
const extraSbx = await Sandbox.create({ metadata: { sandboxTestId } })

// Pause the extra sandbox
await Sandbox.betaPause(sandbox.sandboxId)
await Sandbox.pause(sandbox.sandboxId)

try {
// Test pagination with limit
Expand Down
23 changes: 0 additions & 23 deletions packages/python-sdk/e2b/sandbox_async/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,29 +643,6 @@ async def pause(
**self.connection_config.get_api_params(**opts),
)

@overload
async def beta_pause(
self,
**opts: Unpack[ApiParams],
) -> bool: ...

@overload
@staticmethod
async def beta_pause(
sandbox_id: str,
**opts: Unpack[ApiParams],
) -> bool: ...

@class_method_variant("_cls_pause")
async def beta_pause(
self,
**opts: Unpack[ApiParams],
) -> bool:
"""
:deprecated: Use `pause()` instead.
"""
return await self.pause(**opts)

@overload
async def create_snapshot(
self,
Expand Down
23 changes: 0 additions & 23 deletions packages/python-sdk/e2b/sandbox_sync/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,29 +645,6 @@ def pause(
**self.connection_config.get_api_params(**opts),
)

@overload
def beta_pause(
self,
**opts: Unpack[ApiParams],
) -> bool: ...

@overload
@staticmethod
def beta_pause(
sandbox_id: str,
**opts: Unpack[ApiParams],
) -> bool: ...

@class_method_variant("_cls_pause")
def beta_pause(
self,
**opts: Unpack[ApiParams],
) -> bool:
"""
:deprecated: Use `pause()` instead.
"""
return self.pause(**opts)

@overload
def create_snapshot(
self,
Expand Down
8 changes: 4 additions & 4 deletions packages/python-sdk/tests/async/api_async/test_sbx_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def test_list_running_sandboxes(

@pytest.mark.skip_debug()
async def test_list_paused_sandboxes(async_sandbox: AsyncSandbox, sandbox_test_id: str):
await async_sandbox.beta_pause()
await async_sandbox.pause()

paginator = AsyncSandbox.list(
query=SandboxQuery(
Expand Down Expand Up @@ -101,13 +101,13 @@ async def test_paginate_running_sandboxes(sandbox_test_id: str, async_sandbox_fa
async def test_paginate_paused_sandboxes(
async_sandbox: AsyncSandbox, sandbox_test_id: str, async_sandbox_factory
):
await async_sandbox.beta_pause()
await async_sandbox.pause()

# create another paused sandbox
extra_sbx = await async_sandbox_factory(
metadata={"sandbox_test_id": sandbox_test_id}
)
await extra_sbx.beta_pause()
await extra_sbx.pause()

# Test pagination with limit
paginator = AsyncSandbox.list(
Expand Down Expand Up @@ -145,7 +145,7 @@ async def test_paginate_running_and_paused_sandboxes(
extra_sbx = await async_sandbox_factory(
metadata={"sandbox_test_id": sandbox_test_id}
)
await extra_sbx.beta_pause()
await extra_sbx.pause()

# Test pagination with limit
paginator = AsyncSandbox.list(
Expand Down
8 changes: 4 additions & 4 deletions packages/python-sdk/tests/sync/api_sync/test_sbx_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_list_running_sandboxes(sandbox: Sandbox, sandbox_test_id: str):

@pytest.mark.skip_debug()
def test_list_paused_sandboxes(sandbox: Sandbox, sandbox_test_id: str):
sandbox.beta_pause()
sandbox.pause()

paginator = Sandbox.list(
query=SandboxQuery(
Expand Down Expand Up @@ -102,11 +102,11 @@ def test_paginate_running_sandboxes(
def test_paginate_paused_sandboxes(
sandbox: Sandbox, sandbox_factory, sandbox_test_id: str
):
sandbox.beta_pause()
sandbox.pause()

# create another paused sandbox
extra_sbx = sandbox_factory(metadata={"sandbox_test_id": sandbox_test_id})
extra_sbx.beta_pause()
extra_sbx.pause()

# Test pagination with limit
paginator = Sandbox.list(
Expand Down Expand Up @@ -143,7 +143,7 @@ def test_paginate_running_and_paused_sandboxes(
):
# Create extra paused sandbox
extra_sbx = sandbox_factory(metadata={"sandbox_test_id": sandbox_test_id})
extra_sbx.beta_pause()
extra_sbx.pause()

# Test pagination with limit
paginator = Sandbox.list(
Expand Down
Loading