Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
f6a34fd
acc: a model and a secret named after a renamed schema are deleted at…
denik Nov 17, 2026
97551c4
direct: only the fields naming a UC resource's parent follow the pare…
denik Nov 17, 2026
dd3927f
Add changelog fragment for the parent ID fields fix
denik Nov 17, 2026
97cbfc5
Rename registered models in place and follow parent renames
denik Nov 5, 2026
074dd7d
Link PR in changelog fragment
denik Nov 5, 2026
4ca7e29
direct: read a moved model's aliases when the plan could not
denik Nov 5, 2026
b18917f
Drop the alias read for a model the plan could not read; delete model…
denik Nov 6, 2026
c42e331
acc: show the skipped schema_id change in the model rename plans
denik Nov 9, 2026
56fd46f
Point comment at followsParentRename
denik Nov 9, 2026
74f17af
direct: let the framework re-key a model that only follows its parent…
denik Nov 9, 2026
65278bf
direct: never send a model's name with new_name
denik Nov 10, 2026
603c7f0
acc: also deploy registered_models/rename from a saved plan (READPLAN)
denik Nov 10, 2026
b87e94f
Make the changelog entry mirror the PR title
denik Nov 16, 2026
60633a8
acc: the model follows the schema's rename in rename_with_model_and_s…
denik Nov 16, 2026
15f209d
acc: regenerate the registered model goldens after rebase
denik Nov 16, 2026
dc2dcd3
testserver: report a missing registered model with UC's message
denik Nov 16, 2026
638cb08
acc: a registered model follows a catalog rename in catalogs/rename
denik Nov 16, 2026
c51b8bb
acc: a registered model follows its catalog and schema renamed in one…
denik Nov 16, 2026
8fbc9c9
acc: update, rename and recreate a registered model after its schema …
denik Nov 16, 2026
5694294
acc: a registered model moved out of a renamed schema is deleted wher…
denik Nov 16, 2026
c20dd17
acc: a job reading a registered model's full_name and id follows its …
denik Nov 16, 2026
c3999e6
acc: grants follow a registered model's in-place rename
denik Nov 16, 2026
01f3424
acc: keep volumes/rename_catalog_and_schema about volumes; the model …
denik Nov 16, 2026
9e352d0
acc: keep volumes/move_from_renamed_schema about volumes; the model c…
denik Nov 16, 2026
24efc32
acc: keep schemas/rename_with_volume_ref about the volume
denik Nov 16, 2026
bd02d89
acc: keep grants/volume_change_name about the volume; the model case …
denik Nov 16, 2026
498c874
acc: a registered model follows its catalog and schema renamed in one…
denik Nov 16, 2026
e743974
acc: a registered model moved out of a renamed schema is deleted wher…
denik Nov 16, 2026
20f9942
acc: grants follow a registered model's in-place rename
denik Nov 16, 2026
8702f6f
acc: trim registered_models/rename to the model's own rename
denik Nov 16, 2026
c2a2e5c
testserver: reject creating a registered model that already exists, a…
denik Nov 16, 2026
6930f24
acc: a model whose schema is renamed out of band is created again (Ba…
denik Nov 16, 2026
9f2dabe
acc: a model whose schema rename is interrupted is created again (Bad…
denik Nov 16, 2026
d1a2a06
testserver: reject renaming a registered model onto a taken name, as …
denik Nov 17, 2026
4d735dc
acc: renaming a registered model onto a taken name fails and keeps bo…
denik Nov 17, 2026
0f39e2a
direct: sync a model's aliases before renaming it (review R1)
denik Nov 17, 2026
906fddd
direct: take a renamed model's ID from the response, like create does…
denik Nov 17, 2026
61c8eb6
direct: record the ID a parent's rename moved a resource to before up…
denik Nov 17, 2026
80db03d
acc: a renamed model keeps its versions, and a failed alias leaves it…
denik Nov 17, 2026
eb9e85c
acc: an interrupted schema rename now updates the volume at its recor…
denik Nov 17, 2026
a6cd20d
acc: a model named after a renamed schema is renamed in place
denik Nov 17, 2026
b2c3a1f
Group the deployplan import with the other bundle imports
denik Nov 17, 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
1 change: 1 addition & 0 deletions .nextchanges/bundles/parent-id-fields.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Delete the old resource when its name follows a renamed schema. ([#7718](https://github.com/databricks/cli/pull/7718))
1 change: 1 addition & 0 deletions .nextchanges/bundles/registered-model-rename.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Rename registered models in place and follow parent renames. ([#7379](https://github.com/databricks/cli/pull/7379))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Generated] nit: "Follow parent renames" is an internal term. Could this say what users see, as schema-rename.md does: a model in a renamed catalog or schema is no longer recreated and keeps its versions?

Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@

>>> replay_tfstate.py terraform-requests.json terraform.tfstate

=== Rename the model (an immutable id field) and deploy on direct
=== Rename the model (an updatable id field) and deploy on direct

>>> DATABRICKS_BUNDLE_ENGINE=direct [CLI] bundle deploy
Warn: migration to direct: registered_models.my_model: name differs between config ("themodel-[UNIQUE_NAME]-renamed") and terraform state ("themodel-[UNIQUE_NAME]"); this resource will be recreated.
Warn: migration to direct: registered_models.my_model: name differs between config ("themodel-[UNIQUE_NAME]-renamed") and terraform state ("themodel-[UNIQUE_NAME]"); this resource will be renamed.
Notice: migrating your bundle to direct deployment engine (https://github.com/databricks/cli/issues/6765).
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files...
Migrated 2 resources to direct deployment engine.
Recreated registered_models.my_model
Updated registered_models.my_model
Files: 2 uploaded, 0 deleted
Resources: 1 created, 0 changed, 1 deleted, 1 unchanged
Resources: 0 created, 1 changed, 0 deleted, 1 unchanged

>>> print_migration_telemetry
direct_migrate_recreate_planned true
direct_migrated_via_env true

=== Redeploy on direct: the model now matches config, so the plan is a clean no-op
Expand Down
10 changes: 4 additions & 6 deletions acceptance/bundle/migrate/auto/registered-model-rename/script
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ title "Replay the prior terraform deployment (captured from a real terraform run
trace replay_tfstate.py terraform-requests.json terraform.tfstate
rm -f "$OUT_REQUESTS"

title "Rename the model (an immutable id field) and deploy on direct"
# name is a provided id field on registered models, so a rename recreates. reconcileIDFields
# seeds the deployed name into the converted state, so the migration's plan sees a real
# recreate. Unlike schemas/volumes, registered models are not in the destructive-approval
# group (a model recreate loses no data), so the deploy is approved without --auto-approve:
# the migration commits and the recreate applies on direct.
title "Rename the model (an updatable id field) and deploy on direct"
# name is an updatable id field: the model is renamed in place (UpdateWithID), keeping its
# versions. reconcileIDFields seeds the deployed name into the converted state, so the
# migration's plan sees a rename rather than snapshotting the new name as already applied.
update_file.py databricks.yml "themodel-$UNIQUE_NAME" "themodel-$UNIQUE_NAME-renamed"
trace DATABRICKS_BUNDLE_ENGINE=direct $CLI bundle deploy
trace print_migration_telemetry
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/migrate/auto/volume-type-change/script
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export DATABRICKS_BUNDLE_ENGINE=

# Testserver-only: changing volume_type to EXTERNAL needs a storage_location backed by a
# registered external location on a real workspace, so this is not Cloud-enabled. The
# recreate class it covers is verified on cloud by schema-catalog-change / registered-model-rename.
# recreate class it covers is verified on cloud by schema-catalog-change / registered-model-catalog-change.

# volume_type is both a provided id field and a recreate_on_changes field. reconcileIDFields
# records the deployed value, so the migration's plan sees a real change and recreates. Volumes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ resources:
catalog_name: ${resources.catalogs.catalog1.name}
schema_name: ${resources.schemas.schema1.name}
name: myvolume
registered_models:
model1:
catalog_name: ${resources.catalogs.catalog1.name}
schema_name: ${resources.schemas.schema1.name}
name: mymodel
97 changes: 84 additions & 13 deletions acceptance/bundle/resources/catalogs/rename/output.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@

=== Deploy a catalog with a schema and a volume in it
=== Deploy a catalog with a schema, a volume and a registered model in it

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
Created catalogs.catalog1
Created registered_models.model1
Created schemas.schema1
Created volumes.volume1
Files: 2 uploaded, 0 deleted
Resources: 3 created, 0 changed, 0 deleted, 0 unchanged
Resources: 4 created, 0 changed, 0 deleted, 0 unchanged

>>> print_requests.py //unity-catalog
>>> print_requests.py --sort //unity-catalog
{
"method": "POST",
"path": "/api/2.1/unity-catalog/catalogs",
"body": {
"name": "test_catalog_[UNIQUE_NAME]"
}
}
{
"method": "POST",
"path": "/api/2.1/unity-catalog/models",
"body": {
"catalog_name": "test_catalog_[UNIQUE_NAME]",
"name": "mymodel",
"schema_name": "myschema"
}
}
{
"method": "POST",
"path": "/api/2.1/unity-catalog/schemas",
Expand All @@ -40,7 +50,7 @@ Resources: 3 created, 0 changed, 0 deleted, 0 unchanged

>>> update_file.py databricks.yml test_catalog_ test_catalog_renamed_

=== UC moves the schema and the volume with the catalog, so the plan re-keys them instead of recreating them
=== UC moves the schema, the volume and the model with the catalog, so the plan re-keys them instead of recreating them

>>> [CLI] bundle plan --output json
{
Expand All @@ -53,7 +63,6 @@ Resources: 3 created, 0 changed, 0 deleted, 0 unchanged
},
"remote_state": {
"catalog_type": "MANAGED_CATALOG",
"created_at": [UNIX_TIME_MILLIS][0],
"created_by": "[USERNAME]",
"full_name": "test_catalog_[UNIQUE_NAME]",
"name": "test_catalog_[UNIQUE_NAME]",
Expand All @@ -69,6 +78,59 @@ Resources: 3 created, 0 changed, 0 deleted, 0 unchanged
}
}
},
"resources.registered_models.model1": {
"depends_on": [
{
"node": "resources.catalogs.catalog1",
"label": "${resources.catalogs.catalog1.name}"
},
{
"node": "resources.schemas.schema1",
"label": "${resources.schemas.schema1.name}"
}
],
"action": "update_id",
"state_only": true,
"new_state": {
"value": {
"catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
"name": "mymodel",
"schema_name": "myschema"
}
},
"remote_state": {
"catalog_name": "test_catalog_[UNIQUE_NAME]",
"created_by": "[USERNAME]",
"full_name": "test_catalog_[UNIQUE_NAME].myschema.mymodel",
"name": "mymodel",
"owner": "[USERNAME]",
"schema_name": "myschema"
},
"changes": {
"catalog_name": {
"action": "update_id",
"reason": "parent_renamed",
"old": "test_catalog_[UNIQUE_NAME]",
"new": "test_catalog_renamed_[UNIQUE_NAME]",
"remote": "test_catalog_[UNIQUE_NAME]"
},
"created_by": {
"action": "skip",
"reason": "output_only",
"remote": "[USERNAME]"
},
"full_name": {
"action": "skip",
"reason": "backend_default",
"remote": "test_catalog_[UNIQUE_NAME].myschema.mymodel"
},
"owner": {
"action": "skip",
"reason": "backend_default",
"remote": "[USERNAME]"
}
}
},
"resources.schemas.schema1": {
"depends_on": [
{
Expand All @@ -87,7 +149,6 @@ Resources: 3 created, 0 changed, 0 deleted, 0 unchanged
"remote_state": {
"catalog_name": "test_catalog_[UNIQUE_NAME]",
"catalog_type": "MANAGED_CATALOG",
"created_at": [UNIX_TIME_MILLIS][1],
"created_by": "[USERNAME]",
"full_name": "test_catalog_[UNIQUE_NAME].myschema",
"name": "myschema",
Expand Down Expand Up @@ -133,7 +194,6 @@ Resources: 3 created, 0 changed, 0 deleted, 0 unchanged
},
"remote_state": {
"catalog_name": "test_catalog_[UNIQUE_NAME]",
"created_at": [UNIX_TIME_MILLIS][2],
"created_by": "[USERNAME]",
"full_name": "test_catalog_[UNIQUE_NAME].myschema.myvolume",
"name": "myvolume",
Expand All @@ -160,13 +220,13 @@ Resources: 3 created, 0 changed, 0 deleted, 0 unchanged
}
}

=== Deploy renames the catalog. UC moves the schema and the volume with it, so they get no request
=== Deploy renames the catalog. UC moves the schema, the volume and the model with it, so they get no request

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
Updated catalogs.catalog1
Files: 1 uploaded, 0 deleted
Resources: 0 created, 1 changed, 0 deleted, 2 unchanged
Resources: 0 created, 1 changed, 0 deleted, 3 unchanged

>>> print_requests.py //unity-catalog
{
Expand All @@ -179,7 +239,7 @@ Resources: 0 created, 1 changed, 0 deleted, 2 unchanged
}
}

=== The old catalog is gone and the schema and the volume are under the new one, with their original ids
=== The old catalog is gone and the schema, the volume and the model are under the new one, not recreated
old catalog is gone

>>> [CLI] schemas get test_catalog_renamed_[UNIQUE_NAME].myschema
Expand All @@ -196,13 +256,23 @@ old catalog is gone
"volume_id": "[VOLUME_ID]"
}

>>> [CLI] registered-models get test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel
{
"full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel",
"catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
"created_at": [MODEL_CREATED_AT]
}

=== The state tracks the new paths

>>> [CLI] bundle summary --output json
{
"catalogs": {
"catalog1": "test_catalog_renamed_[UNIQUE_NAME]"
},
"registered_models": {
"model1": "test_catalog_renamed_[UNIQUE_NAME].myschema.mymodel"
},
"schemas": {
"schema1": "test_catalog_renamed_[UNIQUE_NAME].myschema"
},
Expand All @@ -214,18 +284,19 @@ old catalog is gone
=== Redeploy is a no-op

>>> [CLI] bundle plan
Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged
Plan: 0 to add, 0 to change, 0 to delete, 4 unchanged

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
Files: 0 uploaded, 0 deleted
Resources: 0 created, 0 changed, 0 deleted, 3 unchanged
Resources: 0 created, 0 changed, 0 deleted, 4 unchanged

>>> print_requests.py //unity-catalog

>>> [CLI] bundle destroy --auto-approve
The following resources will be deleted:
delete resources.catalogs.catalog1
delete resources.registered_models.model1
delete resources.schemas.schema1
delete resources.volumes.volume1

Expand All @@ -240,4 +311,4 @@ is removed from the catalog, but the underlying files are not deleted:

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

Destroy: 3 deleted
Destroy: 4 deleted
15 changes: 9 additions & 6 deletions acceptance/bundle/resources/catalogs/rename/script
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,31 @@ cleanup() {
}
trap cleanup EXIT

title "Deploy a catalog with a schema and a volume in it"
title "Deploy a catalog with a schema, a volume and a registered model in it"
trace $CLI bundle deploy
trace print_requests.py //unity-catalog
# The volume and the model are created in parallel.
trace print_requests.py --sort //unity-catalog
add_repl "$($CLI schemas get "$OLD_CATALOG.myschema" | jq -r .schema_id)" SCHEMA_ID
add_repl "$($CLI volumes read "$OLD_CATALOG.myschema.myvolume" | jq -r .volume_id)" VOLUME_ID
add_repl "$($CLI registered-models get "$OLD_CATALOG.myschema.mymodel" | jq -r .created_at)" MODEL_CREATED_AT

title "Rename the catalog"
trace update_file.py databricks.yml test_catalog_ test_catalog_renamed_

title "UC moves the schema and the volume with the catalog, so the plan re-keys them instead of recreating them"
title "UC moves the schema, the volume and the model with the catalog, so the plan re-keys them instead of recreating them"
# Drop the remote_state fields that differ between clouds or from the test server.
trace $CLI bundle plan --output json | tee .databricks/plan.json | jq .plan | normalize_uc_payload.py updated_at updated_by metastore_id browse_only effective_predictive_optimization_flag enable_predictive_optimization isolation_mode securable_type storage_location
trace $CLI bundle plan --output json | tee .databricks/plan.json | jq .plan | normalize_uc_payload.py created_at updated_at updated_by metastore_id browse_only effective_predictive_optimization_flag enable_predictive_optimization isolation_mode securable_type storage_location

title "Deploy renames the catalog. UC moves the schema and the volume with it, so they get no request"
title "Deploy renames the catalog. UC moves the schema, the volume and the model with it, so they get no request"
trace $CLI bundle deploy $(readplanarg .databricks/plan.json)
trace print_requests.py //unity-catalog

title "The old catalog is gone and the schema and the volume are under the new one, with their original ids"
title "The old catalog is gone and the schema, the volume and the model are under the new one, not recreated"
# Not traced: the "not found" message differs between UC and the test server.
$CLI catalogs get "$OLD_CATALOG" &> /dev/null && echo "old catalog still exists" || echo "old catalog is gone"
trace $CLI schemas get "$NEW_CATALOG.myschema" | jq '{full_name, catalog_name, schema_id}'
trace $CLI volumes read "$NEW_CATALOG.myschema.myvolume" | jq '{full_name, catalog_name, volume_id}'
trace $CLI registered-models get "$NEW_CATALOG.myschema.mymodel" | jq '{full_name, catalog_name, created_at}'

title "The state tracks the new paths"
trace $CLI bundle summary --output json | jq '.resources | map_values(map_values(.id))'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
bundle:
name: test-bundle-$UNIQUE_NAME

resources:
schemas:
schema1:
catalog_name: main
name: test-schema-$UNIQUE_NAME
registered_models:
model1:
catalog_name: main
schema_name: ${resources.schemas.schema1.name}
name: mymodel
grants:
- principal: deco-test-user@databricks.com
privileges:
- APPLY_TAG
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Cloud = true
EnvMatrix.DMS = ["", "true"]
Loading
Loading