Add "Export as bundle": parameterized DAB export for cross-workspace promotion - #233
Open
arnavc wants to merge 2 commits into
Open
Add "Export as bundle": parameterized DAB export for cross-workspace promotion#233arnavc wants to merge 2 commits into
arnavc wants to merge 2 commits into
Conversation
Export a Genie space as a parameterized Databricks Asset Bundle:
- backend/services/bundle_exporter.py: pure transform (serialized_space dict
-> {path: contents}); auto-detects the source catalog.schema prefix and
rewrites every reference to ${var.catalog}.${var.schema} across data
sources, example SQL, join specs, and benchmarks.
- GET /api/spaces/{id}/export-bundle: fetches the space via OBO, runs the
exporter, streams a .zip (databricks.yml + resources/*.genie_space.yml +
README). Optional prod_* query params add a promotion target.
- SpaceDetail: 'Export as bundle' button + api.ts blob-download helper.
Verified the transform produces serialized_space byte-identical to a
hand-built bundle that deployed and validated on a real workspace.
Co-authored-by: Isaac
The export endpoint already accepted optional prod_host/prod_catalog/ prod_schema/prod_warehouse_id query params, but the UI never sent them, so the generated bundle was always dev-only. This wires up a dialog that collects the four prod-target fields when the user clicks 'Export as bundle': - api.ts: exportSpaceBundle() now takes an optional ExportProdTarget and forwards the four values as query params. - SpaceDetail.tsx: the button opens a dialog (repo's AlertDialog + Input) instead of exporting immediately. Prod fields are all-or-nothing — fill all four to bake a deployable prod target into databricks.yml, or leave them blank for a dev-only bundle (a code backup). The dialog notes that Workbench cannot deploy across a workspace boundary; the user deploys the bundle with their own prod credentials. Frontend build + typecheck pass. Co-authored-by: Isaac
arnavc
marked this pull request as ready for review
June 24, 2026 22:16
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
Adds an Export as bundle action to the Space detail view that downloads a
Genie space as a parameterized Databricks Asset Bundle (
.zip). Every tablereference is rewritten to
${var.catalog}.${var.schema}.<table>, so the samespace definition can be deployed to another workspace by overriding the target's
variables.
This is the GitOps / cross-workspace promotion story for Genie spaces: author and
iterate in Workbench, then export a versionable, deployable bundle.
What it does
Clicking Export as bundle opens a dialog:
with a
devtarget pointing at the current workspace).prodtarget, making it deployable to that workspace withdatabricks bundle deploy -t prod.The bundle contains
databricks.yml(variables + dev/prod targets), an inlinedresources/<key>.genie_space.yml(the parameterized space), and aREADME.mdwith deploy steps.
Why inline
serialized_space(the core technical choice)databricks bundle generate genie-spaceemits the space to an externalfile_path:JSON. DAB variables (${var.x}) do not interpolate inside afile_path-referenced JSON — only inside config written directly in the YAML.So this exporter inlines the definition under
serialized_space:and tokenizesthe catalog/schema there, which is what makes parameterization actually resolve at
deploy time across all sections (data sources, example SQL, join specs, benchmarks).
Changes (additive; +658 / −5 across 4 files)
backend/services/bundle_exporter.pyserialized_spacedict →{path: contents}); prefix detection + recursive parameterization. No Databricks calls, no new deps (usesyaml).backend/routers/spaces.pyGET /api/spaces/{id}/export-bundle(OBO fetch → parameterize → stream zip). Optionalprod_*query params.frontend/src/lib/api.tsexportSpaceBundle()helper (binary download + optional prod target).frontend/src/pages/SpaceDetail.tsxAlertDialog/Input).The 5 removed lines are import statements extended in place — all prior symbols
retained. No existing endpoint, function, dependency, or auth path is modified.
Scope / boundary (by design)
Workbench runs in one workspace via OBO, which cannot cross workspace boundaries.
So this generates the bundle; the user deploys it to the target workspace
with their own credentials (
databricks auth login+bundle deploy -t prod).Cross-workspace deploy is intentionally out of the app.
Testing
npm run build(typecheck + Vite) passes.bundle to a second workspace, and confirmed the deployed space resolves 100% to
the target catalog/schema and answers live Genie queries.
Open questions for maintainers
integrate with a saved "environments" concept?
grow a Git-commit / CI-trigger path (deploy via a CI service principal)?
target tables; worth a pre-deploy catalog/schema/table check?
on others; is full multi-prefix mapping in scope?
This pull request and its description were written by Isaac and tested end to end extensively by Arnav.