Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8a24091
bundle: add genie_spaces resource for direct deploy
janniklasrose Apr 21, 2026
f5a9b28
bundle: retry genie_space create on 400 INVALID_PARAMETER_VALUE missi…
janniklasrose Apr 30, 2026
3fe9d10
bundle: register genie_space file_path translation in unified path vi…
janniklasrose Apr 30, 2026
1706660
bundle: normalize inline serialized_space to JSON string before plan
janniklasrose Apr 30, 2026
41b19bb
bundle: reject genie_space permissions during plan
janniklasrose Apr 30, 2026
e5af0e6
bundle: warn on dual genie_space sources and clarify direct-only error
janniklasrose Apr 30, 2026
4bb02d8
bundle: round-trip parent_path through generate genie-space
janniklasrose Apr 30, 2026
62c7c19
bundle: lint cleanups for genie_space changes
janniklasrose Apr 30, 2026
fc7a59c
bundle: skip genie_space serialized_space in update when unchanged lo…
janniklasrose May 7, 2026
ba59c4e
bundle: fix watch loop in generate genie-space
janniklasrose May 7, 2026
456e4da
bundle: honor --key flag in generate genie-space
janniklasrose May 7, 2026
f91c20b
bundle: guard empty serialized_space in generate genie-space
janniklasrose May 7, 2026
efdb09a
bundle: collapse DoRead into responseToGenieSpaceConfig for genie_space
janniklasrose May 7, 2026
e5930e4
bundle: fill genie_space schema annotations
janniklasrose May 7, 2026
a926825
bundle: lint cleanups for genie_space review fixes
janniklasrose May 7, 2026
dfbc1c6
Regenerate test toml
janniklasrose May 18, 2026
e4809d6
Agent review
janniklasrose May 20, 2026
273cb87
bundle: update genie_space test fixture to v2 export format
janniklasrose May 20, 2026
b64a950
bundle: align genie_space generate with new dstate.DB Open signature
janniklasrose May 20, 2026
d633f4a
bundle: revert non-genie direct-only error message tweak
janniklasrose May 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions acceptance/bundle/generate/genie_space/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bundle:
name: genie-space-generate
7 changes: 7 additions & 0 deletions acceptance/bundle/generate/genie_space/genie_space.json.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"title": "test genie space",
"description": "test description",
"parent_path": "/Workspace/test-$UNIQUE_NAME",
"warehouse_id": "test-warehouse-id",
"serialized_space": "{\"tables\":[],\"questions\":[]}"
}
3 changes: 3 additions & 0 deletions acceptance/bundle/generate/genie_space/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"questions": [],
"tables": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resources:
genie_spaces:
test_genie_space:
title: "test genie space"
warehouse_id: test-warehouse-id
file_path: ../genie_space/test_genie_space.geniespace.json
description: test description
parent_path: /Workspace/test-[UNIQUE_NAME]
6 changes: 6 additions & 0 deletions acceptance/bundle/generate/genie_space/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

>>> [CLI] workspace mkdirs /Workspace/test-[UNIQUE_NAME]

>>> [CLI] bundle generate genie-space --existing-id [GENIE_SPACE_ID] --genie-space-dir out/genie_space --resource-dir out/resource
Writing genie space to out/genie_space/test_genie_space.geniespace.json
Writing configuration to out/resource/test_genie_space.genie_space.yml
8 changes: 8 additions & 0 deletions acceptance/bundle/generate/genie_space/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
trace $CLI workspace mkdirs /Workspace/test-$UNIQUE_NAME

# create a genie space to import
envsubst < genie_space.json.tmpl > genie_space.json
genie_space_id=$($CLI genie create-space --json @genie_space.json | jq -r '.space_id')
rm genie_space.json

trace $CLI bundle generate genie-space --existing-id $genie_space_id --genie-space-dir out/genie_space --resource-dir out/resource
10 changes: 10 additions & 0 deletions acceptance/bundle/generate/genie_space/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[[Repls]]
Old = '\\\\'
New = '/'

[[Repls]]
Old = "[0-9a-f]{32}"
New = "[GENIE_SPACE_ID]"

[Env]
MSYS_NO_PATHCONV = "1"
1 change: 1 addition & 0 deletions acceptance/bundle/help/bundle-generate/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Available Commands:
alert Generate configuration for an alert
app Generate bundle configuration for a Databricks app
dashboard Generate configuration for a dashboard
genie-space Generate configuration for a Genie space
job Generate bundle configuration for a job
pipeline Generate bundle configuration for a pipeline

Expand Down
18 changes: 18 additions & 0 deletions acceptance/bundle/refschema/out.fields.txt
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,24 @@ resources.external_locations.*.grants[*] catalog.PrivilegeAssignment ALL
resources.external_locations.*.grants[*].principal string ALL
resources.external_locations.*.grants[*].privileges []catalog.Privilege ALL
resources.external_locations.*.grants[*].privileges[*] catalog.Privilege ALL
resources.genie_spaces.*.description string ALL
resources.genie_spaces.*.file_path string INPUT
resources.genie_spaces.*.id string INPUT
resources.genie_spaces.*.lifecycle resources.Lifecycle INPUT
resources.genie_spaces.*.lifecycle.prevent_destroy bool INPUT
resources.genie_spaces.*.modified_status string INPUT
resources.genie_spaces.*.parent_path string ALL
resources.genie_spaces.*.serialized_space any ALL
resources.genie_spaces.*.space_id string ALL
resources.genie_spaces.*.title string ALL
resources.genie_spaces.*.url string INPUT
resources.genie_spaces.*.warehouse_id string ALL
resources.genie_spaces.*.permissions.object_id string ALL
resources.genie_spaces.*.permissions[*] dresources.StatePermission ALL
resources.genie_spaces.*.permissions[*].group_name string ALL
resources.genie_spaces.*.permissions[*].level iam.PermissionLevel ALL
resources.genie_spaces.*.permissions[*].service_principal_name string ALL
resources.genie_spaces.*.permissions[*].user_name string ALL
resources.jobs.*.budget_policy_id string ALL
resources.jobs.*.continuous *jobs.Continuous ALL
resources.jobs.*.continuous.pause_status jobs.PauseStatus ALL
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
bundle:
name: deploy-genie-space-inline-$UNIQUE_NAME

resources:
genie_spaces:
sales_analytics:
title: "Sales Analytics Inline Genie"
description: "Inline serialized_space test"
warehouse_id: "test-warehouse-id"
parent_path: /Users/$CURRENT_USER_NAME
serialized_space:
version: 1
config:
sample_questions:
- id: "sq-001"
question: ["What is the total revenue?"]
data_sources:
tables:
- identifier: "main.sales.orders"
column_configs:
- column_name: "amount"
get_example_values: true
33 changes: 33 additions & 0 deletions acceptance/bundle/resources/genie_spaces/inline/out.plan.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"plan_version": 2,
"cli_version": "[DEV_VERSION]",
"lineage": "[UUID]",
"serial": 1,
"plan": {
"resources.genie_spaces.sales_analytics": {
"action": "skip",
"remote_state": {
"description": "Inline serialized_space test",
"etag": "1",
"serialized_space": "{\"config\":{\"sample_questions\":[{\"id\":\"sq-001\",\"question\":[\"What is the total revenue?\"]}]},\"data_sources\":{\"tables\":[{\"column_configs\":[{\"column_name\":\"amount\",\"get_example_values\":true}],\"identifier\":\"main.sales.orders\"}]},\"version\":1}",
"space_id": "[GENIE_SPACE_ID]",
"title": "Sales Analytics Inline Genie",
"warehouse_id": "test-warehouse-id"
},
"changes": {
"etag": {
"action": "skip",
"reason": "custom",
"old": "1",
"remote": "1"
},
"parent_path": {
"action": "skip",
"reason": "input_only",
"old": "/Workspace/Users/[USERNAME]",
"new": "/Workspace/Users/[USERNAME]"
}
}
}
}
}
3 changes: 3 additions & 0 deletions acceptance/bundle/resources/genie_spaces/inline/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions acceptance/bundle/resources/genie_spaces/inline/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-genie-space-inline-[UNIQUE_NAME]/default/files...
Deploying resources...
Updating deployment state...
Deployment complete!

>>> [CLI] bundle plan -o json

>>> [CLI] bundle destroy --auto-approve
The following resources will be deleted:
delete resources.genie_spaces.sales_analytics

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-genie-space-inline-[UNIQUE_NAME]/default

Deleting files...
Destroy complete!
18 changes: 18 additions & 0 deletions acceptance/bundle/resources/genie_spaces/inline/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
}
trap cleanup EXIT

trace $CLI bundle deploy
GENIE_SPACE_ID=$($CLI bundle summary --output json | jq -r '.resources.genie_spaces.sales_analytics.id')

# Capture the genie space ID as a replacement.
echo "$GENIE_SPACE_ID:GENIE_SPACE_ID" >> ACC_REPLS

# Plan after deploy must be drift-free aside from input_only fields.
# Without normalization the inline serialized_space leaves a map in the
# config struct while state holds a string, and structdiff reports false
# drift on every plan.
trace $CLI bundle plan -o json > out.plan.json
6 changes: 6 additions & 0 deletions acceptance/bundle/resources/genie_spaces/inline/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Local = true
RecordRequests = false

Ignore = [
"databricks.yml",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
bundle:
name: recreate-genie-space-$UNIQUE_NAME

resources:
genie_spaces:
recreate_target:
title: "Recreate Target"
warehouse_id: "test-warehouse-id"
parent_path: PARENT_PATH_PLACEHOLDER
serialized_space: "{}"

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/recreate-genie-space-[UNIQUE_NAME]/default/files...
Deploying resources...
Updating deployment state...
Deployment complete!

=== Plan after changing parent_path should show recreate
>>> [CLI] bundle plan
recreate genie_spaces.recreate_target

Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged

>>> [CLI] bundle destroy --auto-approve
The following resources will be deleted:
delete resources.genie_spaces.recreate_target

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/recreate-genie-space-[UNIQUE_NAME]/default

Deleting files...
Destroy complete!
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cleanup() {
trace $CLI bundle destroy --auto-approve
}
trap cleanup EXIT

# Deploy with the original parent_path.
envsubst < databricks.yml.tmpl | sed "s|PARENT_PATH_PLACEHOLDER|/Users/$CURRENT_USER_NAME/genie-old|" > databricks.yml
trace $CLI bundle deploy

# Change parent_path. parent_path is recreate_on_changes in resources.yml,
# so the plan should show a recreate (delete + create) rather than an update.
envsubst < databricks.yml.tmpl | sed "s|PARENT_PATH_PLACEHOLDER|/Users/$CURRENT_USER_NAME/genie-new|" > databricks.yml
title "Plan after changing parent_path should show recreate"
trace $CLI bundle plan
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Local = true
RecordRequests = false

Ignore = [
"databricks.yml",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
bundle:
name: deploy-genie-space-test-$UNIQUE_NAME

resources:
genie_spaces:
sales_analytics:
title: "Sales Analytics Genie"
description: "AI assistant for sales data analysis"
warehouse_id: "test-warehouse-id"
parent_path: /Users/$CURRENT_USER_NAME
file_path: "sales_analytics.geniespace.json"
33 changes: 33 additions & 0 deletions acceptance/bundle/resources/genie_spaces/simple/out.plan.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"plan_version": 2,
"cli_version": "[DEV_VERSION]",
"lineage": "[UUID]",
"serial": 7,
"plan": {
"resources.genie_spaces.sales_analytics": {
"action": "skip",
"remote_state": {
"description": "AI assistant for sales data analysis",
"etag": "1",
"serialized_space": "{\n \"benchmarks\": {\n \"questions\": [\n {\n \"answer\": [\n {\n \"content\": [\n \"SELECT\\n\",\n \" name,\\n\",\n \" country\\n\",\n \"FROM main.default.countries\\n\",\n \"ORDER BY name\"\n ],\n \"format\": \"SQL\"\n }\n ],\n \"id\": \"[NUMID]\",\n \"question\": [\n \"Show all names and countries\"\n ]\n }\n ]\n },\n \"config\": {\n \"sample_questions\": [\n {\n \"id\": \"[NUMID]\",\n \"question\": [\n \"List the names and countries\"\n ]\n },\n {\n \"id\": \"[NUMID]\",\n \"question\": [\n \"Which names are in Canada?\"\n ]\n }\n ]\n },\n \"data_sources\": {\n \"tables\": [\n {\n \"column_configs\": [\n {\n \"column_name\": \"country\",\n \"enable_entity_matching\": true,\n \"enable_format_assistance\": true\n },\n {\n \"column_name\": \"name\",\n \"enable_entity_matching\": true,\n \"enable_format_assistance\": true\n }\n ],\n \"identifier\": \"main.default.countries\"\n }\n ]\n },\n \"instructions\": {\n \"example_question_sqls\": [\n {\n \"id\": \"[NUMID]\",\n \"question\": [\n \"List the names and countries\"\n ],\n \"sql\": [\n \"SELECT\\n\",\n \" name,\\n\",\n \" country\\n\",\n \"FROM main.default.countries\\n\",\n \"ORDER BY name\"\n ]\n }\n ],\n \"text_instructions\": [\n {\n \"content\": [\n \"This genie space answers simple questions about people and their countries.\\n\",\n \"Use only the main.default.countries table.\\n\",\n \"Prefer returning the name and country columns directly.\"\n ],\n \"id\": \"[NUMID]\"\n }\n ]\n },\n \"version\": 2\n}\n",
"space_id": "[GENIE_SPACE_ID]",
"title": "Sales Analytics Genie",
"warehouse_id": "test-warehouse-id"
},
"changes": {
"etag": {
"action": "skip",
"reason": "custom",
"old": "1",
"remote": "1"
},
"parent_path": {
"action": "skip",
"reason": "input_only",
"old": "/Workspace/Users/[USERNAME]",
"new": "/Workspace/Users/[USERNAME]"
}
}
}
}
}
3 changes: 3 additions & 0 deletions acceptance/bundle/resources/genie_spaces/simple/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions acceptance/bundle/resources/genie_spaces/simple/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-genie-space-test-[UNIQUE_NAME]/default/files...
Deploying resources...
Updating deployment state...
Deployment complete!

>>> [CLI] genie get-space [GENIE_SPACE_ID]
{
"title": "Sales Analytics Genie",
"description": "AI assistant for sales data analysis",
"warehouse_id": "test-warehouse-id"
}

>>> [CLI] bundle plan -o json

>>> [CLI] bundle destroy --auto-approve
The following resources will be deleted:
delete resources.genie_spaces.sales_analytics

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-genie-space-test-[UNIQUE_NAME]/default

Deleting files...
Destroy complete!
Loading
Loading