Skip to content

feat: add updateNetwork static method to SandboxInstance#277

Draft
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1774666049-add-update-network
Draft

feat: add updateNetwork static method to SandboxInstance#277
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1774666049-add-update-network

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Mar 28, 2026

Summary

Adds a new updateNetwork static method to SandboxInstance, following the same pattern as updateTtl and updateLifecycle. This allows updating proxy/network config via the existing PUT /sandboxes/{name} endpoint without triggering pod recreation.

The SandboxNetwork type from the generated client is imported as SandboxNetworkConfig to avoid a name collision with the SandboxNetwork class (from ./network/index.js) already used in the file.

Includes an integration test that verifies updating network config preserves sandbox files (i.e., no pod recreation occurred).

Review & Testing Checklist for Human

  • Integration test dependency on controlplane change: The test asserts that updating network config does NOT recreate the pod (file persists). This only works if the corresponding controlplane change (adding NO_PROXY to envVarsIgnored) is deployed to the environment where integration tests run. If the controlplane change isn't deployed yet, this test will fail — verify deployment order or mark test as skipped until the backend change lands.
  • Type alias naming: SandboxNetworkConfig is used to disambiguate from the SandboxNetwork class. Confirm this naming convention is acceptable vs. alternatives (e.g., importing from ../client/types.gen.js directly).
  • Run the integration test (bun run test with appropriate env vars) against a dev environment that has the controlplane NO_PROXY change deployed to verify end-to-end behavior.

Notes

  • Companion controlplane PR adds NO_PROXY to envVarsIgnored — that change must be deployed before this integration test can pass.

Link to Devin session: https://app.devin.ai/sessions/d34971d15d0a42bbaf14d589ffefd426
Requested by: @Joffref


Open with Devin

Note

Adds a updateNetwork static method to SandboxInstance that updates proxy/network config via PUT /sandboxes/{name} without triggering pod recreation. Follows the same pattern as updateTtl and updateLifecycle. Includes an integration test verifying file persistence after the update.

Written by Mendral for commit c963380.

Add updateNetwork() following the same pattern as updateTtl() and
updateLifecycle() to allow updating proxy/network config via the
existing PUT /sandboxes/{name} endpoint without triggering pod recreation.

Import SandboxNetwork type from client as SandboxNetworkConfig to avoid
name collision with the SandboxNetwork class.

Includes integration test verifying that updating network config
preserves sandbox files (no pod recreation).

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Contributor

@mendral-app mendral-app Bot left a comment

Choose a reason for hiding this comment

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

LGTM

The implementation correctly follows the established updateTtl/updateLifecycle pattern — fetch, spread-merge the spec, PUT, return a new attached instance. The SandboxNetworkConfig alias cleanly avoids the name collision with the SandboxNetwork class. No security, correctness, or data-loss issues.

Tag @mendral-app with feedback or questions. View session

Copy link
Copy Markdown
Contributor Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@Joffref Joffref marked this pull request as draft April 16, 2026 19:40
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.

1 participant