Repository navigation
Conversation
Regression test report ✅Commit: Selected 20 changed tests (limit=20, 1 not selected) 23 tests: regression=22 unreleased=0 coverage=1 failing=0
TestAccept/cmd/sandbox/config/update-name: branch ✅ | main (73673ac) ❌ | latest (v1.28.0) ❌main (73673ac): latest (v1.28.0): same output as main (73673ac) TestAccept/cmd/sandbox/create/json/JSON_FLAGS=--json: branch ✅ | main (73673ac) ❌ | latest (v1.28.0) ❌main (73673ac): latest (v1.28.0): same output as main (73673ac) TestAccept/cmd/sandbox/create/json/JSON_FLAGS=-o_json: branch ✅ | main (73673ac) ❌ | latest (v1.28.0) ❌main (73673ac): latest (v1.28.0): same output as main (73673ac) TestAccept/cmd/sandbox/create/with-name: branch ✅ | main (73673ac) ❌ | latest (v1.28.0) ❌main (73673ac): latest (v1.28.0): same output as main (73673ac) TestAccept/cmd/sandbox/default/not-found: branch ✅ | main (73673ac) ❌ | latest (v1.28.0) ❌main (73673ac): latest (v1.28.0): same output as main (73673ac) TestAccept/cmd/sandbox/default/set: branch ✅ | main (73673ac) ❌ | latest (v1.28.0) ❌main (73673ac): latest (v1.28.0): same output as main (73673ac) TestAccept/cmd/sandbox/delete/no-tty-no-auto-approve: branch ✅ | main (73673ac) ❌ | latest (v1.28.0) ❌main (73673ac): latest (v1.28.0): same output as main (73673ac) TestAccept/cmd/sandbox/delete/not-found: branch ✅ | main (73673ac) ❌ | latest (v1.28.0) ❌main (73673ac): latest (v1.28.0): same output as main (73673ac) TestAccept/cmd/sandbox/delete/success: branch ✅ | main (73673ac) ❌ | latest (v1.28.0) ❌main (73673ac): latest (v1.28.0): same output as main (73673ac) TestAccept/cmd/sandbox/forward/forward: branch ✅ | main (73673ac) ❌ | latest (v1.28.0) ❌main (73673ac): latest (v1.28.0): TestAccept/cmd/sandbox/forward/not-found: branch ✅ | main (73673ac) ❌ | latest (v1.28.0) ❌main (73673ac): latest (v1.28.0): TestAccept/cmd/sandbox/lifecycle: branch ✅ | main (73673ac) ❌ | latest (v1.28.0) ❌main (73673ac): latest (v1.28.0): TestAccept/cmd/sandbox/list/empty: branch ✅ | main (73673ac) ❌ | latest (v1.28.0) ❌main (73673ac): latest (v1.28.0): same output as main (73673ac) TestAccept/cmd/sandbox/list/json/JSON_FLAGS=--json: branch ✅ | main (73673ac) ❌ | latest (v1.28.0) ❌main (73673ac): latest (v1.28.0): same output as main (73673ac) 8 more failure details omitted, see the full report in the run. |
There was a problem hiding this comment.
Automated review at 2b5d1b2. Each finding was verified against the code.
Not ready yet: 1 blocking issue(s), tagged [blocking].
This PR moves the sandbox lifecycle commands (create, list, status, config, start, stop, delete) from the legacy gateway endpoints to the SDK's public Sandbox API, and adds a readiness wait to create. The transport swap looks sound and is well covered by HTTP contract tests. The way CLI flags and outputs map onto the public resource changes behavior in ways the description doesn't mention. The main one: --no-autostop=false now overwrites a user's configured idle timeout with 10m. Smaller ones: conflicting auto-stop flags are resolved silently, unnamed sandboxes report their ID as name, and any unmapped state becomes "Unknown", which the wait loops never treat as terminal.
Questions
createnow generatessandbox-<uuid>IDs (44 characters), where the server used to issue short ones likehappy-panda-1234. Users type these IDs intossh,start,stopandconfig, and every help example still uses the short form. Is this format intended? Could the request omitSandboxIdso the server picks it, or use a shorter random suffix if the goal is only to know the ID after a timed-out create? (non-blocking)--idle-timeout 0used to be documented as "clear and revert to the manager's default (10m)". It now sends0sto the public API, which disables idle auto-stop, and only the help text changed. Scripts that pass 0 to reset would leave compute running. Should 0 map todefaultAutoStopSecs, leaving--no-autostopas the only way to disable, or should the new meaning stay and be called out in the changelog? (non-blocking)- Lifecycle responses no longer carry a gateway host. That makes
createResponse.GatewayHost,sandboxEntry.GatewayHost, thesetGatewayHostcalls in create/start/config/status/list, and the related comments in list.go and state.go dead code.removeSandboxstill deletes the profile'sGatewayHostsentry, and now onlyregisterwrites it back. Should this PR remove that plumbing, or should it go in a follow-up? (non-blocking)
|
Updated for 53b5aebd, including the decision to output native SDK JSON.
Local formatting, checks, lint, affected unit/acceptance tests, and race checks passed. At this commit, the same lifecycle scenario passed against both the testserver and real staging, with byte-identical normalized output against the unchanged golden; both owned test resources were verified deleted. The broader SSH/SCP/SFTP checks were not rerun for this commit. Full CI integration results and applicable human approval remain separate requirements; the user merge hold remains active. Source and coverage: ID generator, SDK adapter, CLI lifecycle regressions, and acceptance lifecycle. |
| } | ||
| cfg.WorkspaceID = "" | ||
| } | ||
| clientCfg, err := config.HTTPClientConfigFromConfig(cfg) |
There was a problem hiding this comment.
Why is this needed?
This API doesn't work at the account level.
There was a problem hiding this comment.
Removed the config-copy workaround in 7d52e36. These commands require MustWorkspaceClient; the existing workspace-client setup rejects account-only named profiles. The sandbox client now reuses the validated workspace config directly and rejects the account-only none sentinel with a workspace-profile error; its regression verifies no request or config mutation. Numeric workspace routing remains the SDK's responsibility; this change adds no account-level API support.
|
|
||
| // create calls POST /api/2.0/lakebox/sandboxes. An empty `name` is omitted | ||
| // so the server treats it as "unset" rather than "explicit empty string". | ||
| // sandboxFromSDK keeps the CLI's status vocabulary and JSON field names. |
There was a problem hiding this comment.
Why not change the output? I recommend against remapping from the API payload to something local.
There was a problem hiding this comment.
I originally intended to retain the existing CRUD command output contract and make the underlying change to SDK transparent to CLI users so this PR doesn't affect user's experience. If we directly serialize the SDK response here, the output would go from:
{
"sandboxId": "happy-panda-1234",
"status": "Running",
"name": "my-project",
"idleTimeout": "900s",
"noAutostop": false
}
to
{
"name": "sandboxes/happy-panda-1234",
"display_name": "my-project",
"spec": {
"compute": {
"inactivity_timeout": "900s"
}
},
"status": {
"state": "SANDBOX_STATE_RUNNING"
}
}
That said, if that's the general conversion for CLI pattern, happy to skip the extra conversion.
There was a problem hiding this comment.
Implemented: create/status/list JSON now serializes the SDK Sandbox resources directly, with the compatibility DTOs and remapping removed. The same lifecycle acceptance test passes against the testserver and a real backend, with byte-identical normalized output against the unchanged golden at 53b5aeb. The full CI integration matrix is still running.
| return all, nil | ||
| } | ||
| pageToken = page.NextPageToken | ||
| all = append(all, *sandboxFromSDK(&sb)) |
There was a problem hiding this comment.
Same here; remapping is an anti-pattern.
There was a problem hiding this comment.
Updated for 53b5aebd: list returns []sdk.Sandbox from the SDK iterator, and JSON encodes those resources directly. The JSON compatibility DTO and per-item output remapping have been removed, following your recommendation.
There was a problem hiding this comment.
Updated for 53b5aebd: list returns native SDK resources, and the JSON rendering branch serializes them directly. There is no output compatibility adapter.
Create/status/list JSON now uses the SDK schema: name is the resource path, display_name is the label, status.state contains the SDK enum, and the timeout is spec.compute.inactivity_timeout. The legacy sandboxId, idleTimeout, and synthetic noAutostop fields are no longer emitted. Scripts using the old schema must migrate; readable text, command flags, and short-ID handling retain their behavior.
The native list JSON golden covers the output schema. The same lifecycle scenario passed against the testserver and real staging with byte-identical normalized output against the unchanged golden at this commit. That validation is separate from the full CI integration matrix and human review.
| assert.Equal(t, "test-account", w.Config.AccountID) | ||
| assert.Equal(t, server.URL, w.Config.Host) | ||
| assert.Equal(t, "test-token", w.Config.Token) | ||
| } |
There was a problem hiding this comment.
None of these tests are necessary if you use the regular SDK methods.
There was a problem hiding this comment.
Removed api_public_test.go's SDK serialization, routing and pagination assertions in 7d52e36. The shared testserver is exercised using the normal workspaceClient.Sandbox methods. The smaller lifecycle_test.go retains tests for CLI-owned behavior: short generated IDs, independent display labels, omitted persistence settings, caching accepted IDs before readiness, and cancellation/uncertain-outcome recovery errors. The acceptance lifecycle scenario exercises the flags and command output against real state changes. No separate SDK implementation is under test.
| "compute": { | ||
| "inactivity_timeout": "900s" | ||
| } | ||
| } |
There was a problem hiding this comment.
Instead of updating all backend fixtures, you can remove all of them and implement coverage for the sandbox APIs in the testserver.
There was a problem hiding this comment.
Implemented in 7d52e36. Sandbox lifecycle state now lives in libs/testserver/sandboxes.go, exercised through the ordinary SDK methods. The acceptance tests seed resources through create/get/stop and then run the real CLI against that shared state. All lifecycle response fixtures are removed, including missing-resource fixtures; the regional-unavailability case uses the existing fault helper. A new acceptance lifecycle test covers create, configuration, stop/start, idempotent start, list and delete, and records the CLI requests. The remaining proxy fixture belongs to the forwarding test, not lifecycle CRUD.
✅ Integration test reportCommit: a9a45ec
Top 3 slowest tests (at least 2 minutes):
|
Changes
Use the public Sandbox SDK for sandbox create, list, status, configuration, start, stop and delete. Preserve familiar
<adjective>-<noun>-<four digits>IDs for new sandboxes, keep--nameas the display label, and preserve the existing behavior of returning from create once the sandbox is running. Keep accepted sandbox IDs discoverable if readiness fails or is cancelled. Preserve terminal status names and auto-stop behavior. JSON output uses the native Sandbox SDK schema; scripts using legacy fields must migrate.Why
Lifecycle commands currently use legacy gateway endpoints. The public Sandbox SDK supports managing both existing and new sandboxes alongside SSH port forwarding. The migration keeps the CLI experience consistent while moving lifecycle requests to the supported SDK.
Correct an inherited AI tools changelog fragment's PR attribution so full-history preview validation succeeds.
Tests
Testserver at 6a42b17a: Sandbox acceptance covers native SDK JSON (
name,display_name,status.state, andspec.compute.inactivity_timeout). The lifecycle scenario records public SDK requests and validates create with storage omitted, get/list, rename, a 15-minute inactivity timeout, auto-stop disable/reset to 10 minutes, stop toSTOPPED, start toRUNNING, idempotent start, delete and subsequent not-found status.E2Dogfood (AWS staging), 2026-11-30: the same lifecycle scenario passed using the CLI built from clean 6a42b17a, with
CLOUD_ENV=awsand the harness's-forcerunmanual opt-in. Its 3,337 normalized output bytes exactly matched the unchanged golden and the same-binary testserver run (SHA-2567b03fb3290b27b462a3d8c3f15cb83dcbcb57895a287fb5da0a6fb806f371985). The single owned sandbox was independently verified deleted by HTTP 404, and temporary credentials were removed.At 6a42b17a, formatting, checks, focused Sandbox acceptance, acceptance-framework/selection tests and lint passed, as did all four required CI checks.
After merging
mainat 4f5c79ad, affected Sandbox/testserver/proxy/framework unit tests, the Sandbox acceptance subtree (process-isolated testserver), formatting, checks and lint passed. The region-unavailable test retains all three public API retries and now asserts command failure withmusterr. CI results for this merge are separate from the earlier green run.Changelog follow-up at a9a45eca: the actual preview validator passes with CI settings (
GITHUB_ACTIONS=true,PR_NUMBER=8040,BASE_REF=main), as do scoped whitespace and diff checks. This follow-up changes one attribution link only; the code and backend validation above retain their stated commit scope. CI at this head completed: 22 checks SUCCESS, 8 SKIPPED; all six integration cells report 88 PASS, 1 RECOVERED and 27 SKIPPED each (combined summary: 89 pass / 27 skip).Earlier implementation heads also passed full unit/tools and acceptance suites and lifecycle/SSH/SCP/SFTP checks for both creation paths. Those broader checks were not rerun for this merge. Applicable human review remains a separate requirement.