Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
28b9a4b
Bump direct deployment state version to 3
shreyas-goenka Sep 16, 2026
6dafed6
Test DMS state features and configuration guards
shreyas-goenka Sep 16, 2026
ae485dd
Explain direct state version compatibility in changelog
shreyas-goenka Sep 16, 2026
17ea6fa
Cover state migration with old and current CLI acceptance tests
shreyas-goenka Sep 16, 2026
13a9c01
Keep featureless version 3 state regression test
shreyas-goenka Sep 16, 2026
d86a3d9
Make CLI and state compatibility permutations explicit
shreyas-goenka Sep 16, 2026
5abe0f1
Name compatibility matrix cases by CLI version
shreyas-goenka Sep 16, 2026
eda945a
Use main until the state-version release is published
shreyas-goenka Sep 16, 2026
bdc131d
Verify released CLI downloads are reused across tests
shreyas-goenka Sep 16, 2026
40f9211
Simplify state compatibility tests into accept and reject groups
shreyas-goenka Sep 16, 2026
e025b6f
Show state-preservation assertions in acceptance output
shreyas-goenka Sep 16, 2026
41cfb4c
Expose cached CLI v1.8.0 by default in acceptance tests
shreyas-goenka Sep 16, 2026
fe6dc22
Simplify state-version compatibility changelog
shreyas-goenka Sep 16, 2026
2b9feb6
Prioritize state version errors and highlight compatibility change
shreyas-goenka Sep 16, 2026
9d00a0c
Merge latest main into state-version bump
shreyas-goenka Sep 16, 2026
f65216f
Simplify notable changelog and assert future state remains unchanged
shreyas-goenka Sep 16, 2026
17353eb
Clarify notable state-version compatibility change
shreyas-goenka Sep 16, 2026
6306735
Link changelog to same-repository PR
shreyas-goenka Sep 16, 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/notable-changes/direct-state-v3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Bump the direct deployment state version to 3. Clients older than v1.8.0 will reject bundles deployed with this release. ([#6713](https://github.com/databricks/cli/pull/6713))
4 changes: 4 additions & 0 deletions acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ func testAccept(t *testing.T, inprocessMode bool, selectedTests []string, skipTo
t.Setenv("CLI_293", cli293Path)
repls.SetPath(cli293Path, "[CLI_293]")

cli18Path := DownloadCLI(t, buildDir, "1.8.0")
t.Setenv("CLI_1_8", cli18Path)
repls.SetPath(cli18Path, "[CLI_1_8]")

// CLI version that predates the hashed_fields feature. Used by acceptance/bundle/hashing
cli1161Path := DownloadCLI(t, buildDir, "1.16.1")
t.Setenv("CLI_1_16_1", cli1161Path)
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/deploy/wal/chain-3-jobs/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Exit code: [KILLED]
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"serial": 1,
"state_version": 2
"state_version": 3
}
{
"k": "resources.jobs.job_01",
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/deploy/wal/crash-after-create/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Exit code: [KILLED]

>>> cat .databricks/bundle/default/resources.json.wal
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"serial": 1
Expand Down
4 changes: 2 additions & 2 deletions acceptance/bundle/deploy/wal/header-only-wal/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/defaul
Exit code: [KILLED]

>>> cat .databricks/bundle/default/resources.json.wal
{"state_version":2,"cli_version":"[CLI_VERSION]","lineage":"[UUID]","serial":1}
{"state_version":3,"cli_version":"[CLI_VERSION]","lineage":"[UUID]","serial":1}

=== Second deploy (killed again, leaves another header-only WAL)
>>> errcode [CLI] bundle deploy --force-lock
Expand All @@ -17,7 +17,7 @@ Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/defaul
Exit code: [KILLED]

>>> cat .databricks/bundle/default/resources.json.wal
{"state_version":2,"cli_version":"[CLI_VERSION]","lineage":"[UUID]","serial":1}
{"state_version":3,"cli_version":"[CLI_VERSION]","lineage":"[UUID]","serial":1}

=== Third deploy (must recover and succeed, not blocked by the leftover WAL)
>>> errcode [CLI] bundle deploy --force-lock
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"serial": 2,
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/dms/declined-deploy/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged

>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/dms/depends-on/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
=== The raw recorded state the service holds for this deployment
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/dms/empty-grants/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
=== The raw recorded state the service holds for this deployment
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down
4 changes: 2 additions & 2 deletions acceptance/bundle/dms/existing-state/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged

>>> jq {state_version, features} .databricks/bundle/default/resources.json
{
"state_version": 2,
"state_version": 3,
"features": null
}

Expand Down Expand Up @@ -77,7 +77,7 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged

>>> jq {state_version, features} .databricks/bundle/default/resources.json
{
"state_version": 2,
"state_version": 3,
"features": {
"deployment_history": {}
}
Expand Down
4 changes: 2 additions & 2 deletions acceptance/bundle/dms/failed-delete/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
=== The raw state after successful deploy
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down Expand Up @@ -178,7 +178,7 @@ API message: Fault injected by test.
=== The state shows the resource still exists but the operation is marked failed
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down
4 changes: 2 additions & 2 deletions acceptance/bundle/dms/failed-recreate/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
=== The raw state after successful deploy
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down Expand Up @@ -173,7 +173,7 @@ Files: 2 uploaded, 0 deleted
=== The raw state after failed recreate shows no resource
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down
4 changes: 2 additions & 2 deletions acceptance/bundle/dms/failed-update-permissions/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
=== The raw recorded state after deploy
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down Expand Up @@ -94,7 +94,7 @@ Files: 1 uploaded, 0 deleted
=== The raw recorded state after the failure
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down
4 changes: 2 additions & 2 deletions acceptance/bundle/dms/multiple-resources/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 5 unchanged
=== The raw recorded state the service holds for this deployment
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down Expand Up @@ -130,7 +130,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 5 unchanged
=== The raw recorded state after redeploy
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down
4 changes: 2 additions & 2 deletions acceptance/bundle/dms/no-drift/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
=== The raw recorded state the service holds for this deployment
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down Expand Up @@ -178,7 +178,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
=== The raw recorded state the service holds after the update
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down
4 changes: 2 additions & 2 deletions acceptance/bundle/dms/no-resources/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 0 unchanged
=== The raw recorded state the service holds for this deployment
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down Expand Up @@ -113,7 +113,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 0 unchanged
=== The raw recorded state after redeploy
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down
4 changes: 2 additions & 2 deletions acceptance/bundle/dms/operation-upload-fails-once/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
=== The raw recorded state after deploy
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down Expand Up @@ -76,7 +76,7 @@ Files: 2 uploaded, 0 deleted
=== The raw recorded state after the failure
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/dms/provenance/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
=== The raw recorded state the service holds for this deployment
>>> print_state.py --no-dms -t dev
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/dms/record-failure/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged

>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/dms/stale-plan/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
=== The raw recorded state the service holds for this deployment
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down
9 changes: 9 additions & 0 deletions acceptance/bundle/dms/state-features/databricks.yml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
bundle:
name: dms-state-features-$UNIQUE_NAME
experimental:
deployment_history: true

resources:
jobs:
foo:
name: state-features

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

51 changes: 51 additions & 0 deletions acceptance/bundle/dms/state-features/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

=== Deploy records version 3 and the deployment_history feature, with resources held in DMS
>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dms-state-features-[UNIQUE_NAME]/default/files...
Created jobs.foo
Files: 3 uploaded, 0 deleted
Resources: 1 created, 0 changed, 0 deleted, 0 unchanged

>>> jq {state_version, features, state} .databricks/bundle/default/resources.json
{
"state_version": 3,
"features": {
"deployment_history": {}
},
"state": {}
}

=== Reopening version 3 reads resources from DMS and produces a no-op plan
>>> [CLI] bundle plan
Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged

>>> print_requests.py --dms //resources --get --oneline
{"method": "GET", "path": "/api/2.0/bundle/deployments/[NUMID]/resources"}

=== Disabling deployment history refuses plan, deploy, and destroy
>>> musterr env DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY=false [CLI] bundle plan
Error: unsetting experimental.deployment_history is not supported

This deployment's resources are recorded with the deployment history feature enabled. Set experimental.deployment_history: true to deploy or destroy this bundle


>>> musterr env DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY=false [CLI] bundle deploy
Error: unsetting experimental.deployment_history is not supported

This deployment's resources are recorded with the deployment history feature enabled. Set experimental.deployment_history: true to deploy or destroy this bundle


>>> musterr env DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY=false [CLI] bundle destroy --auto-approve
Error: unsetting experimental.deployment_history is not supported

This deployment's resources are recorded with the deployment history feature enabled. Set experimental.deployment_history: true to deploy or destroy this bundle


>>> print_requests.py --dms //api/2.0/bundle --oneline

=== Reenabling deployment history still reads the unchanged resources from DMS
>>> [CLI] bundle plan
Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged

>>> print_requests.py --dms //resources --get --oneline
{"method": "GET", "path": "/api/2.0/bundle/deployments/[NUMID]/resources"}
25 changes: 25 additions & 0 deletions acceptance/bundle/dms/state-features/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
envsubst < databricks.yml.tmpl > databricks.yml

title "Deploy records version 3 and the deployment_history feature, with resources held in DMS"
trace $CLI bundle deploy
trace jq '{state_version, features, state}' .databricks/bundle/default/resources.json
rm -f "$OUT_REQUESTS"

title "Reopening version 3 reads resources from DMS and produces a no-op plan"
trace $CLI bundle plan
trace print_requests.py --dms //resources --get --oneline

title "Disabling deployment history refuses plan, deploy, and destroy"
update_file.py databricks.yml 'deployment_history: true' 'deployment_history: false'
for command in plan deploy; do
trace musterr env DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY=false $CLI bundle "$command" 2>&1 | contains.py "unsetting experimental.deployment_history is not supported"
done
trace musterr env DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY=false $CLI bundle destroy --auto-approve 2>&1 | contains.py "unsetting experimental.deployment_history is not supported"
trace print_requests.py --dms //api/2.0/bundle --oneline

title "Reenabling deployment history still reads the unchanged resources from DMS"
update_file.py databricks.yml 'deployment_history: false' 'deployment_history: true'
trace $CLI bundle plan
trace print_requests.py --dms //resources --get --oneline

rm -f "$OUT_REQUESTS"
4 changes: 2 additions & 2 deletions acceptance/bundle/dms/successful-recreate/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
=== The raw recorded state the service holds for this deployment
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down Expand Up @@ -189,7 +189,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
=== The raw recorded state after recreate
>>> print_state.py --no-dms
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"features": {
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/migrate/basic/out.new_state.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"serial": 6,
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/migrate/dashboards/out.new_state.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"serial": 3,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"serial": 5,
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/migrate/grants/out.new_state.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"state_version": 2,
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"serial": 9,
Expand Down
Loading
Loading