[CJ-75152][lakebox] CLI: fix CreateSandbox wire format + add --name + surface name/timestamps#2
Open
akshaysingla-db wants to merge 1 commit into
Conversation
… 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
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The auto-create path on
lakebox sshcurrently fails with:CreateSandboxRequest { Sandbox sandbox = 1 }hasbody: "*", so the wire body must be wrapped as{"sandbox": {...}}. The CLI was sending an unwrapped{"public_key": "..."}payload.Sandboxhas nopublic_keyfield anywhere on the create path (proto or handler), so the field was dead end-to-end.lakebox createworked only because its default emptypublicKeywas stripped byomitemptybefore the request went out.While here, plug a few related gaps in the CLI surface:
{"sandbox": {...}}; drop deadpublic_keyfield and--public-key-fileflag.name,createTime,lastStartTimeonsandboxEntrysolakebox status --jsonandlakebox list --jsonstop silently dropping these fields.--nametolakebox createandlakebox config(proto + handler accept name on create + update; CLI had no way to set it).namein humanlakebox statusoutput when set.Test plan
lakebox create(no flags) — provisions, prints sandbox ID.lakebox create --name my-project— name visible inlakebox 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 .— includesname,createTime,lastStartTime.Jira: CJ-75152
This pull request and its description were written by Isaac.