feat(workspace): mb workspace list/get/create/destroy#33
Draft
escherize wants to merge 2 commits into
Draft
Conversation
Thin wrappers over /api/ee/workspace-manager (EE, v62+, workspaces premium feature). create provisions warehouse isolation blocking; destroy confirms, supports --ignore-pending, and surfaces orphaned_resources. Lifecycle e2e self-skips until the server carries the workspaces token feature. connect + profile-write land with the parent credentials endpoint. Refs GHY-4050
${VAR:-} injected an empty METASTORE_DEV_SERVER_URL; Metabase's
dev-mode token check treats empty as configured and builds a hostless
URL, so token validation always failed. Bare list-syntax entries only
pass through when the shell defines them, letting the staging
token-check fallback work.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Refs GHY-4050 (Linear).
CLI half of Option B's workspace lifecycle:
mb workspacewraps the existing EE/api/ee/workspace-managersurface so a local agent can create, inspect, and destroy a disposable workspace from the terminal. The parent does all the heavy lifting (warehouse isolation DDL); the CLI is deliberately thin wrappers plus safety rails.Why the shape it has
capabilities: { minVersion: 62, tokenFeature: "workspaces" }— workspace-manager exists on master only (absent from release-x.61.x, verified against the metabase repo), and the route is premium-gated on:workspaces.createtakes--name+--database-idsflags rather than a JSON body: the server contract is a closed two-field map, and the sequence doc's UX (mb workspace create --database-ids 1,2) is flag-shaped.destroyprompts (or--yes), supports--ignore-pending(the server's escape hatch when a database is stuck mid-provision), and surfacesorphaned_resources— it's the billing-stop lever, so the result must say what was left behind.connectand create-writes-ws-<name>-profile — blocked on the parent returning{name, url, apiKey}(GHY-4058) and thePOST /:id/credentialsendpoint (GHY-4052).Summary
src/domain/workspace.ts—Workspace/WorkspaceCompact/workspaceView; provisioning status pinned as the closed enum from the backend malli schema.src/commands/workspace/{index,list,get,create,destroy}.ts— thin wrappers;wsalias.parseIdCsvinsrc/commands/parse-id.ts(comma-separated id lists) + unit tests.database-enable-workspacesper test), ungated arg-validation, sub-v62 capability-gate block. README + manifest updated.fix(e2e): compose passed${METASTORE_DEV_SERVER_URL:-}, injecting an empty string that Metabase's dev-mode token check treats as configured (hostless URL, token check always failed). Bare list-syntax env entries fix it; the staging fallback now validates the dev token and the token-gated suites actually run.Test plan
databases; 404 message is route-level).bun run test(833), fullbun run test:e2e(371 passed / 3 skipped), tsc, oxlint, oxfmt all green.