Skip to content

Conversation

@nijanthanvijayakumar
Copy link

@nijanthanvijayakumar nijanthanvijayakumar commented Jan 2, 2026

Changes

Adds genie_spaces as a new bundle resource type for deploying AI-powered Genie Spaces via DABs but supporting only direct mode (and not Terraform deploy).

Resource fields: title, description, parent_path, warehouse_id, serialized_space

Features:

  • Direct deploy CRUD operations (create, update, delete).
  • Dev mode prefix (auto-prefixes title with [dev username]).
  • Default parent path to workspace.resource_path.
  • Bundle-level permissions: CAN_MANAGE, CAN_VIEW, CAN_RUN (mapped from bundle's permissions: block).
  • Resource-level permissions: CAN_MANAGE, CAN_EDIT, CAN_RUN, CAN_VIEW (set directly on resource).

Example:

resources:
  genie_spaces:
    sales_assistant:
      title: "Sales Assistant"
      description: "Ask questions about sales data"
      warehouse_id: abc123def456
      serialized_space: '{"version":1,"config":{"sample_questions":[{"id":"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4","question":["Show top 10 sales"]}]},"data_sources":{"tables":[{"identifier":"catalog.schema.sales"}]}}'
      permissions:
        - level: CAN_VIEW
          group_name: data-analysts

Requires direct deploy: DATABRICKS_BUNDLE_ENGINE=direct databricks bundle deploy

Notes: CAN_EDIT has 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

  • Unit tests for resource type, permissions, and state management.
  • Acceptance tests for deploy/destroy lifecycle with mock server.
  • Manual testing on Databricks workspace (screenshots below).

A view of the databricks.yml.

CleanShot 2026-01-02 at 12 08 34@2x

Bundles deployment and validation to Databricks Free Edition

CleanShot 2026-01-02 at 12 14 31@2x

Genie Space creation success ✅

CleanShot 2026-01-02 at 12 02 43@2x

A view of the databricks.yml for testing the update to Genie Space

CleanShot 2026-01-02 at 12 16 48@2x

Bundles deployment and validation to Databricks Free Edition (second try)

CleanShot 2026-01-02 at 12 18 02@2x

Genie Space update success ✅

CleanShot 2026-01-02 at 12 20 09@2x

Bundle destroy

CleanShot 2026-01-02 at 12 21 09@2x

@nijanthanvijayakumar
Copy link
Author

Hi @andrewnester - I am not sure what a cla-required label is - is that a Contributor Licensing Agreement and is there something that I have to do from my end?

@andrewnester
Copy link
Contributor

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

@nijanthanvijayakumar
Copy link
Author

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!

@andrewnester
Copy link
Contributor

@nijanthanvijayakumar, something like this is just enough

Subject: CLA signing

Hey Team,
I would like to sign a CLA in order to contribute to Databricks CLI.

  - 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
@github-actions
Copy link

github-actions bot commented Jan 4, 2026

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 4191
  • Commit SHA: eabf9d93085717535ce596e0eb77ccb4176e8eb0

Checks will be approved automatically on success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants