Skip to content

[CJ-75152][lakebox] CLI: fix CreateSandbox wire format + add --name + surface name/timestamps#2

Open
akshaysingla-db wants to merge 1 commit into
shuochen0311:lakebox-clifrom
akshaysingla-db:akshay/cj-75152-lakebox-cli-fixes
Open

[CJ-75152][lakebox] CLI: fix CreateSandbox wire format + add --name + surface name/timestamps#2
akshaysingla-db wants to merge 1 commit into
shuochen0311:lakebox-clifrom
akshaysingla-db:akshay/cj-75152-lakebox-cli-fixes

Conversation

@akshaysingla-db
Copy link
Copy Markdown

Summary

The auto-create path on lakebox ssh currently fails with:

INVALID_PARAMETER_VALUE: JSON decode error: unknown field `public_key`, expected `sandbox`

CreateSandboxRequest { Sandbox sandbox = 1 } has body: "*", so the wire body must be wrapped as {"sandbox": {...}}. The CLI was sending an unwrapped {"public_key": "..."} payload. Sandbox has no public_key field anywhere on the create path (proto or handler), so the field was dead end-to-end. lakebox create worked only because its default empty publicKey was stripped by omitempty before the request went out.

While here, plug a few related gaps in the CLI surface:

  • Wrap the create body as {"sandbox": {...}}; drop dead public_key field and --public-key-file flag.
  • Surface name, createTime, lastStartTime on sandboxEntry so lakebox status --json and lakebox list --json stop silently dropping these fields.
  • Add --name to lakebox create and lakebox config (proto + handler accept name on create + update; CLI had no way to set it).
  • Print name in human lakebox status output when set.

Test plan

  • lakebox create (no flags) — provisions, prints sandbox ID.
  • lakebox create --name my-project — name visible in lakebox status + lakebox list --json.
  • rm ~/.databricks/lakebox.json && lakebox ssh — auto-creates and connects (this is the previously-broken path).
  • lakebox config <id> --name renamed — name updates.
  • lakebox status <id> --json | jq . — includes name, createTime, lastStartTime.

Jira: CJ-75152

This pull request and its description were written by Isaac.

… surface name/timestamps

The auto-create path on `lakebox ssh` fails with:

  INVALID_PARAMETER_VALUE: JSON decode error:
  unknown field `public_key`, expected `sandbox`

`CreateSandboxRequest { Sandbox sandbox = 1 }` has `body: "*"`, so the
wire body must be wrapped as `{"sandbox": {...}}`. The CLI was sending an
unwrapped `{"public_key": "..."}` payload. `Sandbox` has no `public_key`
field anywhere on the create path (proto or handler), so the field was
dead end-to-end. `lakebox create` worked only because its default empty
publicKey was stripped by `omitempty` before the request went out.

While here, plug a few related gaps in the CLI surface:

- Wrap the create body as `{"sandbox": {...}}`; drop dead `public_key`
  field and `--public-key-file` flag.
- Surface `name`, `createTime`, `lastStartTime` on `sandboxEntry` so
  `lakebox status --json` and `lakebox list --json` stop silently
  dropping these fields.
- Add `--name` to `lakebox create` and `lakebox config` (proto + handler
  accept name on create + update; CLI had no way to set it).
- Print `name` in human `lakebox status` output when set.

Jira: CJ-75152

Co-authored-by: Isaac
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