-
Notifications
You must be signed in to change notification settings - Fork 125
(feat): Add Genie Space resource support for Databricks Asset Bundles [DIRECT mode only] #4191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Hi @andrewnester - I am not sure what a |
|
Hi @nijanthanvijayakumar ! Thanks for the PR! Indeed, contributing to Databricks CLI requires signing CLA, so if that's something you're up for doing, please write a message to [email protected] with CLA sign request and we'll take it from there |
Yeah of course @andrewnester - if there is a template/format that I could follow to send an email, I'd be happy to. Thanks for the reply once again! |
|
@nijanthanvijayakumar, something like this is just enough |
- Add GenieSpace struct with config fields (title, description, parent_path, warehouse_id, serialized_space, file_path) - Add GenieSpacePermission type and IPermission interface implementation - Register genie_spaces in Resources struct
- Implement Create, Read, Update, Delete operations using Genie SDK API - Handle parent_path workspace prefix stripping to match API behavior - Register genie space resource in direct mode registry
- Add ConfigureGenieSpaceSerializedSpace to load file_path content into serialized_space - Emit warning when both file_path and serialized_space are set - Add GenieSpaceFixups to strip /Workspace prefix from parent_path - Register mutators in resource mutator pipeline
- Add genie_spaces to levelsMap with CAN_MANAGE, CAN_VIEW, CAN_RUN mappings. Don't think CAN_EDIT is available in API - Add Title prefixing in development mode (e.g. [dev username] title)
- Add fake genie space CRUD handlers for acceptance tests - Add GenieSpaces map to FakeWorkspace state - Register GET/POST/PATCH/DELETE routes for /api/2.0/genie/spaces
- Add genie_spaces to mockBundle and test assertions - Add permission test coverage for genie spaces - Skip genie_spaces in terraform lifecycle test (direct-mode only)
- Add descriptions for all GenieSpace fields - Document file_path and serialized_space precedence behavior so user can interpret easily and decide which one they should pick
- Add simple genie space deployment test with file_path - Use 32-char hex UUIDs for IDs (API requirement)
Simplifies implementation by removing the file_path indirection. Users specify serialized_space directly as a JSON string
Aligns with API expectations. Simplifies direct deploy code by removing json marshaling logic.
Remove file_path references, update serialized_space description.
Remove sample-genie.json, inline serialized_space as JSON string.
The CI checks started failing for the PR 4191. To resolve those issues and cascading failures due to the root causes, this commit adds enum values for `GenieSpacePermissionLevel` in the annotations file, following the existing DashboardPermissionLevel pattern (as I relied on dashboard implementation to create the GenieSpace implementation) This fixes two CI failures: - validate-python-codegen: schema now has enum for Python codegen to parse - validate-generated-is-up-to-date: regenerated required_fields.go
bd60e93 to
eabf9d9
Compare
|
An authorized user can trigger integration tests manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Changes
Adds
genie_spacesas a new bundle resource type for deploying AI-powered Genie Spaces via DABs but supporting onlydirectmode (and not Terraform deploy).Resource fields:
title,description,parent_path,warehouse_id,serialized_spaceFeatures:
CAN_MANAGE,CAN_VIEW,CAN_RUN(mapped from bundle'spermissions:block).CAN_MANAGE,CAN_EDIT,CAN_RUN,CAN_VIEW(set directly on resource).Example:
Requires direct deploy:
DATABRICKS_BUNDLE_ENGINE=direct databricks bundle deployNotes:
CAN_EDIThas no bundle-level equivalent, so it seems that it has to be set directly on the resource.Why
Solves issue: #3008
Genie Spaces are AI-powered data rooms that let users ask natural language questions about their data. Users requested the ability to manage Genie Spaces as code via DABs for version control and CI/CD workflows.
Direct deploy only: Terraform mode is not supported because the Databricks Terraform provider does not yet have a databricks_genie_space resource. Once the provider adds support, Terraform mode can be enabled.
Tests
A view of the
databricks.yml.Bundles deployment and validation to Databricks Free Edition
Genie Space creation success ✅
A view of the
databricks.ymlfor testing the update to Genie SpaceBundles deployment and validation to Databricks Free Edition (second try)
Genie Space update success ✅
Bundle destroy