Skip to content

Record unbind history outside StateDB - #7818

Open
shreyas-goenka wants to merge 1 commit into
shreyas-goenka_data/shreyas-goenka/out-of-band-bind-historyfrom
shreyas-goenka_data/shreyas-goenka/out-of-band-unbind-history
Open

shreyas-goenka wants to merge 1 commit into
shreyas-goenka_data/shreyas-goenka/out-of-band-bind-historyfrom
shreyas-goenka_data/shreyas-goenka/out-of-band-unbind-history

Conversation

@shreyas-goenka

@shreyas-goenka shreyas-goenka commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Record committed bundle deployment unbind removals as UPDATE operations through a separate history loop. Include removed permissions/grants entries and skip versions when nothing was removed.

Why

Unbind must clear deployment history while preserving workspace resources and StateDB's existing transaction count. History failures warn; state-upload failures still fail the command and recorded version.

Stacked on #7817.

Tests

  • Removed-key and committed-serial unit coverage.
  • Existing DMS fault tests verify remote state after unbind.
  • A focused upload-failure case verifies the command/version fail and the remote binding remains.

This PR was written by Codex.

@shreyas-goenka shreyas-goenka added the DABs DABs related issues label Nov 19, 2026
@shreyas-goenka
shreyas-goenka force-pushed the shreyas-goenka_data/shreyas-goenka/out-of-band-unbind-history branch from f961619 to 572ef11 Compare November 19, 2026 16:19
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Regression test report ✅

Commit: 650d05bd2 | Workflow run

Selected 20 changed tests (limit=20, 3 not selected)

26 tests: regression=16 unreleased=0 coverage=10 failing=0
test branch main (e2048bb) latest (v1.28.0)
TestAccept/bundle/deployment/bind/dashboard/recreation/DMS=/READPLAN= ✅ ✅ ✅
TestAccept/bundle/deployment/bind/dashboard/recreation/DMS=/READPLAN=1 ✅ ✅ ✅
TestAccept/bundle/deployment/bind/dashboard/recreation/DMS=true/READPLAN= ✅ ✅ ✅
TestAccept/bundle/deployment/bind/dashboard/recreation/DMS=true/READPLAN=1 ✅ ✅ ✅
TestAccept/bundle/deployment/bind/feature_spec/DMS=/OUTPUT_MODE=plain ✅ ✅ ✅
TestAccept/bundle/deployment/bind/feature_spec/DMS=true/OUTPUT_MODE=recorded ✅ ❌ ❌
TestAccept/bundle/deployment/bind/pipelines/recreate/DMS= ✅ ✅ ✅
TestAccept/bundle/deployment/bind/pipelines/recreate/DMS=true ✅ ✅ ✅
TestAccept/bundle/deployment/bind/pipelines/update/DMS= ✅ ✅ ✅
TestAccept/bundle/deployment/bind/pipelines/update/DMS=true ✅ ✅ ✅
TestAccept/bundle/dms/bind-immutable/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/bind-unbind/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/bind-upload-failure/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/suppress-transport-warnings/DMS=true ✅ ✅ ✅
TestAccept/bundle/dms/unbind-upload-failure/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms_fault/complete_version/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms_fault/create_deployment/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms_fault/create_version/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms_fault/delete_deployment/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms_fault/get_deployment/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms_fault/get_operation/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms_fault/get_resource/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms_fault/get_version/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms_fault/heartbeat/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms_fault/list_deployments/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms_fault/list_operations/DMS=true ✅ ❌ ❌
TestAccept/bundle/deployment/bind/feature_spec/DMS=true/OUTPUT_MODE=recorded: branch ✅ | main (e2048bb) ❌ | latest (v1.28.0) ❌

main (e2048bb):

acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1155
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle deployment bind spec1 main.fspec_[UNIQUE_NAME].boundspec --auto-approve\nWarn: Failed to record deployment history for bind: failed to create deployment version: operations.resource_key must have a known resource type prefix (e.g. 'jobs.', 'pipelines.'): feature_specs.spec1\nSuccessfully bound feature_spec with an id 'main.fspec_[UNIQUE_NAME].boundspec'\nRun 'bundle deploy' to deploy changes to your workspace\n"
        	            	actual  : "\n>>> [CLI] bundle deployment bind spec1 main.fspec_[UNIQUE_NAME].boundspec --auto-approve\nSuccessfully bound feature_spec with an id 'main.fspec_[UNIQUE_NAME].boundspec'\nRun 'bundle deploy' to deploy changes to your workspace\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,3 +2,2 @@
        	            	 >>> [CLI] bundle deployment bind spec1 main.fspec_[UNIQUE_NAME].boundspec --auto-approve
        	            	-Warn: Failed to record deployment history for bind: failed to create deployment version: operations.resource_key must have a known resource type prefix (e.g. 'jobs.', 'pipelines.'): feature_specs.spec1
        	            	 Successfully bound feature_spec with an id 'main.fspec_[UNIQUE_NAME].boundspec'
        	Test:       	TestAccept/bundle/deployment/bind/feature_spec/DMS=true/OUTPUT_MODE=recorded
        	Messages:   	bundle/deployment/bind/feature_spec/out.bind.recorded.txt vs /tmp/TestAcceptbundledeploymentbindfeature_specDMS=trueOUTPUT_M4146678255/001/out.bind.recorded.txt
    acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1155
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle deployment unbind spec1\nWarn: Failed to record deployment history for unbind: failed to create deployment version: operations.resource_key must have a known resource type prefix (e.g. 'jobs.', 'pipelines.'): feature_specs.spec1\n"
        	            	actual  : "\n>>> [CLI] bundle deployment unbind spec1\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,3 +2,2 @@
        	            	 >>> [CLI] bundle deployment unbind spec1
        	            	-Warn: Failed to record deployment history for unbind: failed to create deployment version: operations.resource_key must have a known resource type prefix (e.g. 'jobs.', 'pipelines.'): feature_specs.spec1
        	            	 
        	Test:       	TestAccept/bundle/deployment/bind/feature_spec/DMS=true/OUTPUT_MODE=recorded
        	Messages:   	bundle/deployment/bind/feature_spec/out.unbind.recorded.txt vs /tmp/TestAcceptbundledeploymentbindfeature_specDMS=trueOUTPUT_M4146678255/001/out.unbind.recorded.txt
    acceptance_test.go:1180: 
        LOG.cleanup: All files and directories at the following location will be deleted: /Workspace/Users/tester@databricks.com/.bundle/test-bind-feature-spec-bckx5mvhtjb7xe7uksj3jevluu/default
        LOG.cleanup: 
        LOG.cleanup: Destroy: 0 deleted
FAIL

latest (v1.28.0):

acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1155
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle deployment bind spec1 main.fspec_[UNIQUE_NAME].boundspec --auto-approve\nWarn: Failed to record deployment history for bind: failed to create deployment version: operations.resource_key must have a known resource type prefix (e.g. 'jobs.', 'pipelines.'): feature_specs.spec1\nSuccessfully bound feature_spec with an id 'main.fspec_[UNIQUE_NAME].boundspec'\nRun 'bundle deploy' to deploy changes to your workspace\n"
        	            	actual  : "\n>>> [CLI] bundle deployment bind spec1 main.fspec_[UNIQUE_NAME].boundspec --auto-approve\nSuccessfully bound feature_spec with an id 'main.fspec_[UNIQUE_NAME].boundspec'\nRun 'bundle deploy' to deploy changes to your workspace\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,3 +2,2 @@
        	            	 >>> [CLI] bundle deployment bind spec1 main.fspec_[UNIQUE_NAME].boundspec --auto-approve
        	            	-Warn: Failed to record deployment history for bind: failed to create deployment version: operations.resource_key must have a known resource type prefix (e.g. 'jobs.', 'pipelines.'): feature_specs.spec1
        	            	 Successfully bound feature_spec with an id 'main.fspec_[UNIQUE_NAME].boundspec'
        	Test:       	TestAccept/bundle/deployment/bind/feature_spec/DMS=true/OUTPUT_MODE=recorded
        	Messages:   	bundle/deployment/bind/feature_spec/out.bind.recorded.txt vs /tmp/TestAcceptbundledeploymentbindfeature_specDMS=trueOUTPUT_M3319918896/001/out.bind.recorded.txt
    acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1155
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle deployment unbind spec1\nWarn: Failed to record deployment history for unbind: failed to create deployment version: operations.resource_key must have a known resource type prefix (e.g. 'jobs.', 'pipelines.'): feature_specs.spec1\n"
        	            	actual  : "\n>>> [CLI] bundle deployment unbind spec1\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,3 +2,2 @@
        	            	 >>> [CLI] bundle deployment unbind spec1
        	            	-Warn: Failed to record deployment history for unbind: failed to create deployment version: operations.resource_key must have a known resource type prefix (e.g. 'jobs.', 'pipelines.'): feature_specs.spec1
        	            	 
        	Test:       	TestAccept/bundle/deployment/bind/feature_spec/DMS=true/OUTPUT_MODE=recorded
        	Messages:   	bundle/deployment/bind/feature_spec/out.unbind.recorded.txt vs /tmp/TestAcceptbundledeploymentbindfeature_specDMS=trueOUTPUT_M3319918896/001/out.unbind.recorded.txt
    acceptance_test.go:1180: 
        LOG.cleanup: All files and directories at the following location will be deleted: /Workspace/Users/tester@databricks.com/.bundle/test-bind-feature-spec-udzv27kmcjg3njnvczmqd63fhm/default
        LOG.cleanup: 
        LOG.cleanup: Destroy: 0 deleted
TestAccept/bundle/dms/bind-immutable/DMS=true: branch ✅ | main (e2048bb) ❌ | latest (v1.28.0) ❌

main (e2048bb):

acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1143
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle deployment bind foo [JOB_ID] --auto-approve\nSuccessfully bound job with an id '[JOB_ID]'\nRun 'bundle deploy' to deploy changes to your workspace\n\n>>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-resources deployments/[DEPLOYMENT_ID] -o json\n[\n  {\n    \"last_action_type\": \"OPERATION_ACTION_TYPE_UPDATE\",\n    \"resource_id\": \"[JOB_ID]\",\n    \"resource_key\": \"jobs.foo\"\n  }\n]\n\n=== Bind uploads no files, so the deployment records no file_path\n\n>>> MSYS_NO_PATHCONV=1 [CLI] api get /api/2.0/bundle/deployments/[DEPLOYMENT_ID]\n{\n  \"workspace_info\": {\n    \"root_path\": \"/Workspace/Users/[USERNAME]/.bundle/dms-bind-immutable-[UNIQUE_NAME]/default\"\n  }\n}\n"
        	            	actual  : "\n>>> [CLI] bundle deployment bind foo [JOB_ID] --auto-approve\nSuccessfully bound job with an id '[JOB_ID]'\nRun 'bundle deploy' to deploy changes to your workspace\nError: Path (/Workspace/Users/[USERNAME]/.bundle/dms-bind-immutable-[UNIQUE_NAME]/default/state/resources.deployment.json) doesn't exist.\n\nExit code: 1\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -4,20 +4,5 @@
        	            	 Run 'bundle deploy' to deploy changes to your workspace
        	            	+Error: Path (/Workspace/Users/[USERNAME]/.bundle/dms-bind-immutable-[UNIQUE_NAME]/default/state/resources.deployment.json) doesn't exist.
        	            	 
        	            	->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-resources deployments/[DEPLOYMENT_ID] -o json
        	            	-[
        	            	-  {
        	            	-    "last_action_type": "OPERATION_ACTION_TYPE_UPDATE",
        	            	-    "resource_id": "[JOB_ID]",
        	            	-    "resource_key": "jobs.foo"
        	            	-  }
        	            	-]
        	            	+Exit code: 1
        	            	 
        	            	-=== Bind uploads no files, so the deployment records no file_path
        	            	-
        	            	->>> MSYS_NO_PATHCONV=1 [CLI] api get /api/2.0/bundle/deployments/[DEPLOYMENT_ID]
        	            	-{
        	            	-  "workspace_info": {
        	            	-    "root_path": "/Workspace/Users/[USERNAME]/.bundle/dms-bind-immutable-[UNIQUE_NAME]/default"
        	            	-  }
        	            	-}
        	            	-
        	Test:       	TestAccept/bundle/dms/bind-immutable/DMS=true
        	Messages:   	bundle/dms/bind-immutable/output.txt vs /tmp/TestAcceptbundledmsbind-immutableDMS=true2871674723/002/output.txt

latest (v1.28.0): same output as main (e2048bb)

TestAccept/bundle/dms/bind-unbind/DMS=true: branch ✅ | main (e2048bb) ❌ | latest (v1.28.0) ❌

main (e2048bb):

acceptance_test.go:1402: Diff:
        --- bundle/dms/bind-unbind/output.txt
        +++ /tmp/TestAcceptbundledmsbind-unbindDMS=true670577266/002/output.txt
        @@ -24,122 +24,17 @@
         >>> jq {serial, features, resource_id: .state["resources.jobs.foo"].__id__} .databricks/bundle/default/resources.json
         {
           "serial": 2,
        -  "features": {
        -    "deployment_history_shadow": {}
        -  },
        +  "features": null,
           "resource_id": "[JOB_ID]"
         }
         
         >>> print_requests.py --dms //versions --oneline
        -{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions", "q": {"version_id": "3"}, "body": {"cli_version": "[CLI_VERSION]", "operations": [{"action_type": "OPERATION_ACTION_TYPE_UPDATE", "resource_key": "jobs.foo"}], "version_type": "VERSION_TYPE_DEPLOY"}}
        -{"method": "PATCH", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/3/operations/jobs.foo", "q": {"update_mask": "state,error_message,resource_id,status"}, "body": {"error_message": "", "resource_id": "[JOB_ID]", "sequence_id": 0, "state": "{\"state\":{\"deployment\":{\"kind\":\"BUNDLE\",\"metadata_file_path\":\"/Workspace/Users/[USERNAME]/.bundle/dms-bind-unbind-[UNIQUE_NAME]/default/state/metadata.json\"},\"edit_mode\":\"UI_LOCKED\",\"format\":\"MULTI_TASK\",\"max_concurrent_runs\":1,\"name\":\"foo\",\"queue\":{\"enabled\":true}}}", "status": "OPERATION_STATUS_SUCCEEDED"}}
        -{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/3/complete", "body": {"completion_reason": "VERSION_COMPLETE_SUCCESS"}}
         
         >>> [CLI] jobs get [JOB_ID]
         {
           "job_id": [JOB_ID],
           "name": "bind-target-[UNIQUE_NAME]"
         }
        +Error: Path (/Workspace/Users/[USERNAME]/.bundle/dms-bind-unbind-[UNIQUE_NAME]/default/state/resources.deployment.json) doesn't exist.
         
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-resources deployments/[DEPLOYMENT_ID] -o json
        -[
        -  {
        -    "last_action_type": "OPERATION_ACTION_TYPE_UPDATE",
        -    "resource_id": "[JOB_ID]",
        -    "resource_key": "jobs.foo"
        -  }
        -]
        -
        -=== Deploy keeps the bound job ID with recorded history
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dms-bind-unbind-[UNIQUE_NAME]/default/files...
        -Created jobs.foo.permissions
        -Updated jobs.foo
        -Files: 2 uploaded, 0 deleted
        -Resources: 1 created, 1 changed, 0 deleted, 0 unchanged
        -
        ->>> jq {features, resource_id: .state["resources.jobs.foo"].__id__} .databricks/bundle/default/resources.json
        -{
        -  "features": {
        -    "deployment_history_shadow": {}
        -  },
        -  "resource_id": "[JOB_ID]"
        -}
        -
        -=== Unbind preserves the shadow history marker and leaves the job intact
        -
        ->>> [CLI] bundle deployment unbind foo
        -
        ->>> print_requests.py --dms //versions //jobs //permissions --oneline
        -{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions", "q": {"version_id": "5"}, "body": {"cli_version": "[CLI_VERSION]", "operations": [{"action_type": "OPERATION_ACTION_TYPE_UPDATE", "resource_key": "jobs.foo"}, {"action_type": "OPERATION_ACTION_TYPE_UPDATE", "resource_key": "jobs.foo.permissions"}], "previous_version_id": "4", "version_type": "VERSION_TYPE_DEPLOY"}}
        -{"method": "PATCH", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/5/operations/jobs.foo", "q": {"update_mask": "state,error_message,status"}, "body": {"error_message": "", "sequence_id": 0, "status": "OPERATION_STATUS_SUCCEEDED"}}
        -{"method": "PATCH", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/5/operations/jobs.foo.permissions", "q": {"update_mask": "state,error_message,status"}, "body": {"error_message": "", "sequence_id": 0, "status": "OPERATION_STATUS_SUCCEEDED"}}
        -{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/5/complete", "body": {"completion_reason": "VERSION_COMPLETE_SUCCESS"}}
        -
        ->>> jq {features, state} .databricks/bundle/default/resources.json
        -{
        -  "features": {
        -    "deployment_history_shadow": {}
        -  },
        -  "state": {}
        -}
        -
        ->>> [CLI] jobs get [JOB_ID]
        -{
        -  "job_id": [JOB_ID]
        -}
        -
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-resources deployments/[DEPLOYMENT_ID] -o json
        -[]
        -
        -=== Unbinding an already unbound resource creates no history version
        -
        ->>> [CLI] bundle deployment unbind foo
        -
        ->>> print_requests.py --dms //versions
        -
        -=== Rebind preserves the existing shadow history marker without configuration
        -
        ->>> DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY= [CLI] bundle deployment bind foo [JOB_ID] --auto-approve
        -Successfully bound job with an id '[JOB_ID]'
        -Run 'bundle deploy' to deploy changes to your workspace
        -
        ->>> jq {features, resource_id: .state["resources.jobs.foo"].__id__} .databricks/bundle/default/resources.json
        -{
        -  "features": {
        -    "deployment_history_shadow": {}
        -  },
        -  "resource_id": "[JOB_ID]"
        -}
        -
        ->>> print_requests.py --dms //versions --oneline
        -{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions", "q": {"version_id": "8"}, "body": {"cli_version": "[CLI_VERSION]", "operations": [{"action_type": "OPERATION_ACTION_TYPE_UPDATE", "resource_key": "jobs.foo"}], "previous_version_id": "5", "version_type": "VERSION_TYPE_DEPLOY"}}
        -{"method": "PATCH", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/8/operations/jobs.foo", "q": {"update_mask": "state,error_message,resource_id,status"}, "body": {"error_message": "", "resource_id": "[JOB_ID]", "sequence_id": 0, "state": "{\"state\":{\"deployment\":{\"kind\":\"BUNDLE\",\"metadata_file_path\":\"/Workspace/Users/[USERNAME]/.bundle/dms-bind-unbind-[UNIQUE_NAME]/default/state/metadata.json\"},\"edit_mode\":\"UI_LOCKED\",\"format\":\"MULTI_TASK\",\"max_concurrent_runs\":1,\"name\":\"foo\",\"queue\":{\"enabled\":true}}}", "status": "OPERATION_STATUS_SUCCEEDED"}}
        -{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/8/complete", "body": {"completion_reason": "VERSION_COMPLETE_SUCCESS"}}
        -
        -=== A subsequent deploy continues managing the same job
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dms-bind-unbind-[UNIQUE_NAME]/default/files...
        -Created jobs.foo.permissions
        -Files: 0 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 0 deleted, 1 unchanged
        -
        ->>> jq {features, resource_id: .state["resources.jobs.foo"].__id__} .databricks/bundle/default/resources.json
        -{
        -  "features": {
        -    "deployment_history_shadow": {}
        -  },
        -  "resource_id": "[JOB_ID]"
        -}
        -
        -=== A rejected duplicate bind creates no history version
        -
        ->>> musterr [CLI] bundle deployment bind foo [JOB_ID] --auto-approve
        -Error: Resource already managed
        -
        -The bundle is already managing resource for resources.jobs.foo and it is bound to the requested ID [JOB_ID].
        -
        -
        ->>> print_requests.py --dms //versions
        +Exit code: 1
        
    acceptance_test.go:1180: 
        LOG.cleanup: The following resources will be deleted:
        LOG.cleanup:   delete resources.jobs.foo
        LOG.cleanup: 
        LOG.cleanup: All files and directories at the following location will be deleted: /Workspace/Users/tester@databricks.com/.bundle/dms-bind-unbind-y64p47l7dzafjos76yajjinl6y/default
        LOG.cleanup: 
        LOG.cleanup: Destroy: 1 deleted
        LOG.cleanup: Error: Not Found
        LOG.cleanup: 
        LOG.cleanup: Exit code: 1

latest (v1.28.0):

acceptance_test.go:1402: Diff:
        --- bundle/dms/bind-unbind/output.txt
        +++ /tmp/TestAcceptbundledmsbind-unbindDMS=true1519439513/002/output.txt
        @@ -24,122 +24,17 @@
         >>> jq {serial, features, resource_id: .state["resources.jobs.foo"].__id__} .databricks/bundle/default/resources.json
         {
           "serial": 2,
        -  "features": {
        -    "deployment_history_shadow": {}
        -  },
        +  "features": null,
           "resource_id": "[JOB_ID]"
         }
         
         >>> print_requests.py --dms //versions --oneline
        -{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions", "q": {"version_id": "3"}, "body": {"cli_version": "[CLI_VERSION]", "operations": [{"action_type": "OPERATION_ACTION_TYPE_UPDATE", "resource_key": "jobs.foo"}], "version_type": "VERSION_TYPE_DEPLOY"}}
        -{"method": "PATCH", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/3/operations/jobs.foo", "q": {"update_mask": "state,error_message,resource_id,status"}, "body": {"error_message": "", "resource_id": "[JOB_ID]", "sequence_id": 0, "state": "{\"state\":{\"deployment\":{\"kind\":\"BUNDLE\",\"metadata_file_path\":\"/Workspace/Users/[USERNAME]/.bundle/dms-bind-unbind-[UNIQUE_NAME]/default/state/metadata.json\"},\"edit_mode\":\"UI_LOCKED\",\"format\":\"MULTI_TASK\",\"max_concurrent_runs\":1,\"name\":\"foo\",\"queue\":{\"enabled\":true}}}", "status": "OPERATION_STATUS_SUCCEEDED"}}
        -{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/3/complete", "body": {"completion_reason": "VERSION_COMPLETE_SUCCESS"}}
         
         >>> [CLI] jobs get [JOB_ID]
         {
           "job_id": [JOB_ID],
           "name": "bind-target-[UNIQUE_NAME]"
         }
        +Error: Path (/Workspace/Users/[USERNAME]/.bundle/dms-bind-unbind-[UNIQUE_NAME]/default/state/resources.deployment.json) doesn't exist.
         
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-resources deployments/[DEPLOYMENT_ID] -o json
        -[
        -  {
        -    "last_action_type": "OPERATION_ACTION_TYPE_UPDATE",
        -    "resource_id": "[JOB_ID]",
        -    "resource_key": "jobs.foo"
        -  }
        -]
        -
        -=== Deploy keeps the bound job ID with recorded history
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dms-bind-unbind-[UNIQUE_NAME]/default/files...
        -Created jobs.foo.permissions
        -Updated jobs.foo
        -Files: 2 uploaded, 0 deleted
        -Resources: 1 created, 1 changed, 0 deleted, 0 unchanged
        -
        ->>> jq {features, resource_id: .state["resources.jobs.foo"].__id__} .databricks/bundle/default/resources.json
        -{
        -  "features": {
        -    "deployment_history_shadow": {}
        -  },
        -  "resource_id": "[JOB_ID]"
        -}
        -
        -=== Unbind preserves the shadow history marker and leaves the job intact
        -
        ->>> [CLI] bundle deployment unbind foo
        -
        ->>> print_requests.py --dms //versions //jobs //permissions --oneline
        -{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions", "q": {"version_id": "5"}, "body": {"cli_version": "[CLI_VERSION]", "operations": [{"action_type": "OPERATION_ACTION_TYPE_UPDATE", "resource_key": "jobs.foo"}, {"action_type": "OPERATION_ACTION_TYPE_UPDATE", "resource_key": "jobs.foo.permissions"}], "previous_version_id": "4", "version_type": "VERSION_TYPE_DEPLOY"}}
        -{"method": "PATCH", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/5/operations/jobs.foo", "q": {"update_mask": "state,error_message,status"}, "body": {"error_message": "", "sequence_id": 0, "status": "OPERATION_STATUS_SUCCEEDED"}}
        -{"method": "PATCH", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/5/operations/jobs.foo.permissions", "q": {"update_mask": "state,error_message,status"}, "body": {"error_message": "", "sequence_id": 0, "status": "OPERATION_STATUS_SUCCEEDED"}}
        -{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/5/complete", "body": {"completion_reason": "VERSION_COMPLETE_SUCCESS"}}
        -
        ->>> jq {features, state} .databricks/bundle/default/resources.json
        -{
        -  "features": {
        -    "deployment_history_shadow": {}
        -  },
        -  "state": {}
        -}
        -
        ->>> [CLI] jobs get [JOB_ID]
        -{
        -  "job_id": [JOB_ID]
        -}
        -
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-resources deployments/[DEPLOYMENT_ID] -o json
        -[]
        -
        -=== Unbinding an already unbound resource creates no history version
        -
        ->>> [CLI] bundle deployment unbind foo
        -
        ->>> print_requests.py --dms //versions
        -
        -=== Rebind preserves the existing shadow history marker without configuration
        -
        ->>> DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY= [CLI] bundle deployment bind foo [JOB_ID] --auto-approve
        -Successfully bound job with an id '[JOB_ID]'
        -Run 'bundle deploy' to deploy changes to your workspace
        -
        ->>> jq {features, resource_id: .state["resources.jobs.foo"].__id__} .databricks/bundle/default/resources.json
        -{
        -  "features": {
        -    "deployment_history_shadow": {}
        -  },
        -  "resource_id": "[JOB_ID]"
        -}
        -
        ->>> print_requests.py --dms //versions --oneline
        -{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions", "q": {"version_id": "8"}, "body": {"cli_version": "[CLI_VERSION]", "operations": [{"action_type": "OPERATION_ACTION_TYPE_UPDATE", "resource_key": "jobs.foo"}], "previous_version_id": "5", "version_type": "VERSION_TYPE_DEPLOY"}}
        -{"method": "PATCH", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/8/operations/jobs.foo", "q": {"update_mask": "state,error_message,resource_id,status"}, "body": {"error_message": "", "resource_id": "[JOB_ID]", "sequence_id": 0, "state": "{\"state\":{\"deployment\":{\"kind\":\"BUNDLE\",\"metadata_file_path\":\"/Workspace/Users/[USERNAME]/.bundle/dms-bind-unbind-[UNIQUE_NAME]/default/state/metadata.json\"},\"edit_mode\":\"UI_LOCKED\",\"format\":\"MULTI_TASK\",\"max_concurrent_runs\":1,\"name\":\"foo\",\"queue\":{\"enabled\":true}}}", "status": "OPERATION_STATUS_SUCCEEDED"}}
        -{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/8/complete", "body": {"completion_reason": "VERSION_COMPLETE_SUCCESS"}}
        -
        -=== A subsequent deploy continues managing the same job
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dms-bind-unbind-[UNIQUE_NAME]/default/files...
        -Created jobs.foo.permissions
        -Files: 0 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 0 deleted, 1 unchanged
        -
        ->>> jq {features, resource_id: .state["resources.jobs.foo"].__id__} .databricks/bundle/default/resources.json
        -{
        -  "features": {
        -    "deployment_history_shadow": {}
        -  },
        -  "resource_id": "[JOB_ID]"
        -}
        -
        -=== A rejected duplicate bind creates no history version
        -
        ->>> musterr [CLI] bundle deployment bind foo [JOB_ID] --auto-approve
        -Error: Resource already managed
        -
        -The bundle is already managing resource for resources.jobs.foo and it is bound to the requested ID [JOB_ID].
        -
        -
        ->>> print_requests.py --dms //versions
        +Exit code: 1
        
    acceptance_test.go:1180: 
        LOG.cleanup: The following resources will be deleted:
        LOG.cleanup:   delete resources.jobs.foo
        LOG.cleanup: 
        LOG.cleanup: All files and directories at the following location will be deleted: /Workspace/Users/tester@databricks.com/.bundle/dms-bind-unbind-nipoixn4ufbbjlt4rel7gcgd2i/default
        LOG.cleanup: 
        LOG.cleanup: Destroy: 1 deleted
        LOG.cleanup: Error: Not Found
        LOG.cleanup: 
        LOG.cleanup: Exit code: 1
TestAccept/bundle/dms/bind-upload-failure/DMS=true: branch ✅ | main (e2048bb) ❌ | latest (v1.28.0) ❌

main (e2048bb):

acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1143
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "\n=== A remote state upload failure fails the bind version\n\n>>> fault.py POST /api/2.0/workspace-files/import-file/**resources.json 400 0 1\n\n>>> musterr [CLI] bundle deployment bind upload_failed [JOB_ID] --auto-approve\nError: Fault injected by test. (400 INJECTED)\n\nEndpoint: POST [DATABRICKS_URL]/api/2.0/workspace-files/import-file/Workspace%2FUsers%2F[USERNAME]%2F.bundle%2Fdms-bind-upload-failure-[UNIQUE_NAME]%2Fdefault%2Fstate%2Fresources.json?overwrite=true\nHTTP Status: 400 Bad Request\nAPI error_code: INJECTED\nAPI message: Fault injected by test.\n\n\n>>> print_requests.py --dms //complete --oneline\n{\"method\": \"POST\", \"path\": \"/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/5/complete\", \"body\": {\"completion_reason\": \"VERSION_COMPLETE_FAILURE\"}}\n\n=== Remote state still contains only the successful bindings\n\n>>> [CLI] bundle summary -o json\n{\n  \"kept\": \"[JOB_ID]\",\n  \"upload_failed\": null\n}\n"
        	            	actual  : "\n=== A remote state upload failure fails the bind version\n\n>>> fault.py POST /api/2.0/workspace-files/import-file/**resources.json 400 0 1\n\n>>> musterr [CLI] bundle deployment bind upload_failed [JOB_ID] --auto-approve\nError: Fault injected by test. (400 INJECTED)\n\nEndpoint: POST [DATABRICKS_URL]/api/2.0/workspace-files/import-file/Workspace%2FUsers%2F[USERNAME]%2F.bundle%2Fdms-bind-upload-failure-[UNIQUE_NAME]%2Fdefault%2Fstate%2Fresources.json?overwrite=true\nHTTP Status: 400 Bad Request\nAPI error_code: INJECTED\nAPI message: Fault injected by test.\n\n\n>>> print_requests.py --dms //complete --oneline\n\n=== Remote state still contains only the successful bindings\n\n>>> [CLI] bundle summary -o json\n{\n  \"kept\": \"[JOB_ID]\",\n  \"upload_failed\": null\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -15,3 +15,2 @@
        	            	 >>> print_requests.py --dms //complete --oneline
        	            	-{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/5/complete", "body": {"completion_reason": "VERSION_COMPLETE_FAILURE"}}
        	            	 
        	Test:       	TestAccept/bundle/dms/bind-upload-failure/DMS=true
        	Messages:   	bundle/dms/bind-upload-failure/output.txt vs /tmp/TestAcceptbundledmsbind-upload-failureDMS=true2262958909/002/output.txt
    acceptance_test.go:1180: 
        LOG.setup: Successfully bound job with an id '8795653337937802088'
        LOG.setup: Run 'bundle deploy' to deploy changes to your workspace

latest (v1.28.0):

acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1143
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "\n=== A remote state upload failure fails the bind version\n\n>>> fault.py POST /api/2.0/workspace-files/import-file/**resources.json 400 0 1\n\n>>> musterr [CLI] bundle deployment bind upload_failed [JOB_ID] --auto-approve\nError: Fault injected by test. (400 INJECTED)\n\nEndpoint: POST [DATABRICKS_URL]/api/2.0/workspace-files/import-file/Workspace%2FUsers%2F[USERNAME]%2F.bundle%2Fdms-bind-upload-failure-[UNIQUE_NAME]%2Fdefault%2Fstate%2Fresources.json?overwrite=true\nHTTP Status: 400 Bad Request\nAPI error_code: INJECTED\nAPI message: Fault injected by test.\n\n\n>>> print_requests.py --dms //complete --oneline\n{\"method\": \"POST\", \"path\": \"/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/5/complete\", \"body\": {\"completion_reason\": \"VERSION_COMPLETE_FAILURE\"}}\n\n=== Remote state still contains only the successful bindings\n\n>>> [CLI] bundle summary -o json\n{\n  \"kept\": \"[JOB_ID]\",\n  \"upload_failed\": null\n}\n"
        	            	actual  : "\n=== A remote state upload failure fails the bind version\n\n>>> fault.py POST /api/2.0/workspace-files/import-file/**resources.json 400 0 1\n\n>>> musterr [CLI] bundle deployment bind upload_failed [JOB_ID] --auto-approve\nError: Fault injected by test. (400 INJECTED)\n\nEndpoint: POST [DATABRICKS_URL]/api/2.0/workspace-files/import-file/Workspace%2FUsers%2F[USERNAME]%2F.bundle%2Fdms-bind-upload-failure-[UNIQUE_NAME]%2Fdefault%2Fstate%2Fresources.json?overwrite=true\nHTTP Status: 400 Bad Request\nAPI error_code: INJECTED\nAPI message: Fault injected by test.\n\n\n>>> print_requests.py --dms //complete --oneline\n\n=== Remote state still contains only the successful bindings\n\n>>> [CLI] bundle summary -o json\n{\n  \"kept\": \"[JOB_ID]\",\n  \"upload_failed\": null\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -15,3 +15,2 @@
        	            	 >>> print_requests.py --dms //complete --oneline
        	            	-{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/5/complete", "body": {"completion_reason": "VERSION_COMPLETE_FAILURE"}}
        	            	 
        	Test:       	TestAccept/bundle/dms/bind-upload-failure/DMS=true
        	Messages:   	bundle/dms/bind-upload-failure/output.txt vs /tmp/TestAcceptbundledmsbind-upload-failureDMS=true3929603249/002/output.txt
    acceptance_test.go:1180: 
        LOG.setup: Successfully bound job with an id '8795653352593102790'
        LOG.setup: Run 'bundle deploy' to deploy changes to your workspace
TestAccept/bundle/dms/unbind-upload-failure/DMS=true: branch ✅ | main (e2048bb) ❌ | latest (v1.28.0) ❌

main (e2048bb):

acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1143
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "\n=== A remote state upload failure fails the unbind version\n\n>>> fault.py POST /api/2.0/workspace-files/import-file/**resources.json 400 0 1\n\n>>> musterr [CLI] bundle deployment unbind upload_failed\nError: Fault injected by test. (400 INJECTED)\n\nEndpoint: POST [DATABRICKS_URL]/api/2.0/workspace-files/import-file/Workspace%2FUsers%2F[USERNAME]%2F.bundle%2Fdms-unbind-upload-failure-[UNIQUE_NAME]%2Fdefault%2Fstate%2Fresources.json?overwrite=true\nHTTP Status: 400 Bad Request\nAPI error_code: INJECTED\nAPI message: Fault injected by test.\n\n\n>>> print_requests.py --dms //complete --oneline\n{\"method\": \"POST\", \"path\": \"/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/4/complete\", \"body\": {\"completion_reason\": \"VERSION_COMPLETE_FAILURE\"}}\n\n=== Remote state still contains the binding whose upload failed\n\n>>> [CLI] bundle summary -o json\n{\n  \"upload_failed\": \"[JOB_ID]\"\n}\n"
        	            	actual  : "\n=== A remote state upload failure fails the unbind version\n\n>>> fault.py POST /api/2.0/workspace-files/import-file/**resources.json 400 0 1\n\n>>> musterr [CLI] bundle deployment unbind upload_failed\nError: Fault injected by test. (400 INJECTED)\n\nEndpoint: POST [DATABRICKS_URL]/api/2.0/workspace-files/import-file/Workspace%2FUsers%2F[USERNAME]%2F.bundle%2Fdms-unbind-upload-failure-[UNIQUE_NAME]%2Fdefault%2Fstate%2Fresources.json?overwrite=true\nHTTP Status: 400 Bad Request\nAPI error_code: INJECTED\nAPI message: Fault injected by test.\n\n\n>>> print_requests.py --dms //complete --oneline\n\n=== Remote state still contains the binding whose upload failed\n\n>>> [CLI] bundle summary -o json\n{\n  \"upload_failed\": \"[JOB_ID]\"\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -15,3 +15,2 @@
        	            	 >>> print_requests.py --dms //complete --oneline
        	            	-{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/4/complete", "body": {"completion_reason": "VERSION_COMPLETE_FAILURE"}}
        	            	 
        	Test:       	TestAccept/bundle/dms/unbind-upload-failure/DMS=true
        	Messages:   	bundle/dms/unbind-upload-failure/output.txt vs /tmp/TestAcceptbundledmsunbind-upload-failureDMS=true2569684539/002/output.txt
    acceptance_test.go:1180: 
        LOG.setup: Successfully bound job with an id '8795653337274182032'
        LOG.setup: Run 'bundle deploy' to deploy changes to your workspace

latest (v1.28.0):

acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1143
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "\n=== A remote state upload failure fails the unbind version\n\n>>> fault.py POST /api/2.0/workspace-files/import-file/**resources.json 400 0 1\n\n>>> musterr [CLI] bundle deployment unbind upload_failed\nError: Fault injected by test. (400 INJECTED)\n\nEndpoint: POST [DATABRICKS_URL]/api/2.0/workspace-files/import-file/Workspace%2FUsers%2F[USERNAME]%2F.bundle%2Fdms-unbind-upload-failure-[UNIQUE_NAME]%2Fdefault%2Fstate%2Fresources.json?overwrite=true\nHTTP Status: 400 Bad Request\nAPI error_code: INJECTED\nAPI message: Fault injected by test.\n\n\n>>> print_requests.py --dms //complete --oneline\n{\"method\": \"POST\", \"path\": \"/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/4/complete\", \"body\": {\"completion_reason\": \"VERSION_COMPLETE_FAILURE\"}}\n\n=== Remote state still contains the binding whose upload failed\n\n>>> [CLI] bundle summary -o json\n{\n  \"upload_failed\": \"[JOB_ID]\"\n}\n"
        	            	actual  : "\n=== A remote state upload failure fails the unbind version\n\n>>> fault.py POST /api/2.0/workspace-files/import-file/**resources.json 400 0 1\n\n>>> musterr [CLI] bundle deployment unbind upload_failed\nError: Fault injected by test. (400 INJECTED)\n\nEndpoint: POST [DATABRICKS_URL]/api/2.0/workspace-files/import-file/Workspace%2FUsers%2F[USERNAME]%2F.bundle%2Fdms-unbind-upload-failure-[UNIQUE_NAME]%2Fdefault%2Fstate%2Fresources.json?overwrite=true\nHTTP Status: 400 Bad Request\nAPI error_code: INJECTED\nAPI message: Fault injected by test.\n\n\n>>> print_requests.py --dms //complete --oneline\n\n=== Remote state still contains the binding whose upload failed\n\n>>> [CLI] bundle summary -o json\n{\n  \"upload_failed\": \"[JOB_ID]\"\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -15,3 +15,2 @@
        	            	 >>> print_requests.py --dms //complete --oneline
        	            	-{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/4/complete", "body": {"completion_reason": "VERSION_COMPLETE_FAILURE"}}
        	            	 
        	Test:       	TestAccept/bundle/dms/unbind-upload-failure/DMS=true
        	Messages:   	bundle/dms/unbind-upload-failure/output.txt vs /tmp/TestAcceptbundledmsunbind-upload-failureDMS=true2986012375/002/output.txt
    acceptance_test.go:1180: 
        LOG.setup: Successfully bound job with an id '8795653352484467861'
        LOG.setup: Run 'bundle deploy' to deploy changes to your workspace
TestAccept/bundle/dms_fault/complete_version/DMS=true: branch ✅ | main (e2048bb) ❌ | latest (v1.28.0) ❌

main (e2048bb):

acceptance_test.go:1402: Diff:
        --- bundle/dms_fault/complete_version/output.txt
        +++ /tmp/TestAcceptbundledms_faultcomplete_versionDMS=true3553192389/002/output.txt
        @@ -48,11 +48,9 @@
         
         
         >>> bundle deployment unbind foo
        -  Warn: Failed to complete deployment history version: Fault injected by test.
         
         >>> bundle generate job --existing-job-id [FOO_ID] --key foo --config-dir resources --source-dir src --force --bind
           Job configuration successfully saved to resources/foo.job.yml
        -  Warn: Failed to complete deployment history version: Fault injected by test.
           Successfully bound job with an id '[FOO_ID]'
         
         >>> bundle generate pipeline --existing-pipeline-id [BAR_ID] --key bar --config-dir exported --source-dir exported-src --force
        @@ -68,12 +63,10 @@
         
         
         >>> bundle deployment unbind bar
        -  Warn: Failed to complete deployment history version: Fault injected by test.
         
         >>> bundle generate pipeline --existing-pipeline-id [BAR_ID] --key bar --config-dir resources --source-dir src --force --bind
           File successfully saved to src/pipeline.sql
           Pipeline configuration successfully saved to resources/bar.pipeline.yml
        -  Warn: Failed to complete deployment history version: Fault injected by test.
           Successfully bound pipeline with an id '[BAR_ID]'
         
         >>> bundle validate
        @@ -87,7 +76,7 @@
         
         >>> bundle deploy --auto-approve
           Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dms-fault-complete_version-commands-[UNIQUE_NAME]/files...
        -  Current Deployment Version: [DATABRICKS_URL]/deployments/[DEPLOYMENT_ID]?version=10
        +  Current Deployment Version: [DATABRICKS_URL]/deployments/[DEPLOYMENT_ID]?version=9
           Updated pipelines.bar
           Files: 6 uploaded, 0 deleted
           Resources: 0 created, 1 changed, 0 deleted, 1 unchanged
        
    acceptance_test.go:1180: 
        LOG.commands: 
        LOG.commands: commands: ('bundle', 'deploy', '--auto-approve')
        LOG.commands: exit=0
        LOG.commands: Uploading bundle files to /Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-7zu4g3lyarbchj4dblb3a5ja24/files...
        LOG.commands: Current Deployment Version: http://127.0.0.1:45519/deployments/4000000000000941?version=1
        LOG.commands: Created pipelines.bar
        LOG.commands: Created jobs.foo
        LOG.commands: Files: 4 uploaded, 0 deleted
        LOG.commands: Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        LOG.commands: 
        LOG.commands: commands: ('workspace', 'get-status', '/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-7zu4g3lyarbchj4dblb3a5ja24/state/resources.deployment.json', '-o', 'json')
        LOG.commands: exit=0
        LOG.commands: {
        LOG.commands:   "object_id": 4000000000000941,
        LOG.commands:   "object_type": "BUNDLE_DEPLOYMENT",
        LOG.commands:   "path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-7zu4g3lyarbchj4dblb3a5ja24/state/resources.deployment.json"
        LOG.commands: }
        LOG.commands: 
        LOG.commands: commands: ('bundle', 'deploy', '--auto-approve')
        LOG.commands: exit=0
        LOG.commands: Uploading bundle files to /Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-7zu4g3lyarbchj4dblb3a5ja24/files...
        LOG.commands: Current Deployment Version: http://127.0.0.1:45519/deployments/4000000000000941?version=2
        LOG.commands: Updated pipelines.bar
        LOG.commands: Updated jobs.foo
        LOG.commands: Files: 3 uploaded, 0 deleted
        LOG.commands: Resources: 0 created, 2 changed, 0 deleted, 0 unchanged
        LOG.commands: Warn: Failed to complete deployment history version: Fault injected by test.
        LOG.commands: 
        LOG.commands: commands: ('jobs', 'get', '8795653335591494843', '-o', 'json')
        LOG.commands: exit=0
        LOG.commands: {
        LOG.commands:   "created_time": 1795653335591,
        LOG.commands:   "creator_user_name": "tester@databricks.com",
        LOG.commands:   "job_id": 8795653335591494843,
        LOG.commands:   "run_as_user_name": "tester@databricks.com",
        LOG.commands:   "settings": {
        LOG.commands:     "deployment": {
        LOG.commands:       "deployment_id": "4000000000000941",
        LOG.commands:       "kind": "BUNDLE",
        LOG.commands:       "metadata_file_path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-7zu4g3lyarbchj4dblb3a5ja24/state/metadata.json",
        LOG.commands:       "version_id": "2"
        LOG.commands:     },
        LOG.commands:     "description": "history-true",
        LOG.commands:     "edit_mode": "UI_LOCKED",
        LOG.commands:     "email_notifications": {},
        LOG.commands:     "format": "MULTI_TASK",
        LOG.commands:     "max_concurrent_runs": 1,
        LOG.commands:     "name": "updated-dms-fault-complete_version-commands-7zu4g3lyarbchj4dblb3a5ja24",
        LOG.commands:     "queue": {
        LOG.commands:       "enabled": true
        LOG.commands:     },
        LOG.commands:     "timeout_seconds": 0,
        LOG.commands:     "webhook_notifications": {}
        LOG.commands:   }
        LOG.commands: }
        LOG.commands: 
        LOG.commands: commands: ('pipelines', 'get', '7a10701b-7b54-efa5-7a10-701b7b54f0f0', '-o', 'json')
        LOG.commands: exit=0
        LOG.commands: {
        LOG.commands:   "creator_user_name": "tester@databricks.com",
        LOG.commands:   "effective_publishing_mode": "DEFAULT_PUBLISHING_MODE",
        LOG.commands:   "last_modified": 1795653335590,
        LOG.commands:   "name": "updated-dms-fault-complete_version-commands-7zu4g3lyarbchj4dblb3a5ja24",
        LOG.commands:   "pipeline_id": "7a10701b-7b54-efa5-7a10-701b7b54f0f0",
        LOG.commands:   "run_as_user_name": "tester@databricks.com",
        LOG.commands:   "spec": {
        LOG.commands:     "catalog": "main",
        LOG.commands:     "channel": "CURRENT",
        LOG.commands:     "deployment": {
        LOG.commands:       "deployment_id": "4000000000000941",
        LOG.commands:       "kind": "BUNDLE",
        LOG.commands:       "metadata_file_path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-7zu4g3lyarbchj4dblb3a5ja24/state/metadata.json",
        LOG.commands:       "version_id": "2"
        LOG.commands:     },
        LOG.commands:     "edition": "ADVANCED",
        LOG.commands:     "id": "7a10701b-7b54-efa5-7a10-701b7b54f0f0",
        LOG.commands:     "libraries": [
        LOG.commands:       {
        LOG.commands:         "file": {
        LOG.commands:           "path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-7zu4g3lyarbchj4dblb3a5ja24/files/pipeline.sql"
        LOG.commands:         }
        LOG.commands:       }
        LOG.commands:     ],
        LOG.commands:     "name": "updated-dms-fault-complete_version-commands-7zu4g3lyarbchj4dblb3a5ja24",
        LOG.commands:     "schema": "default",
        LOG.commands:     "serverless": true
        LOG.commands:   },
        LOG.commands:   "state": "IDLE"
        LOG.commands: }
        LOG.commands: 
        LOG.commands: commands: ('bundle', 'summary')
        LOG.commands: exit=0
        LOG.commands: Name: updated-dms-fault-complete_version-commands-7zu4g3lyarbchj4dblb3a5ja24
        LOG.commands: Target: default
        LOG.commands: Workspace:
        LOG.commands:   User: tester@databricks.com
        LOG.commands:   Path: /Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-7zu4g3lyarbchj4dblb3a5ja24
        LOG.commands: Resources:
        LOG.commands:   Jobs:
        LOG.commands:     foo:
        LOG.commands: ... (540 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)

latest (v1.28.0):

acceptance_test.go:1402: Diff:
        --- bundle/dms_fault/complete_version/output.txt
        +++ /tmp/TestAcceptbundledms_faultcomplete_versionDMS=true91821682/002/output.txt
        @@ -48,11 +48,9 @@
         
         
         >>> bundle deployment unbind foo
        -  Warn: Failed to complete deployment history version: Fault injected by test.
         
         >>> bundle generate job --existing-job-id [FOO_ID] --key foo --config-dir resources --source-dir src --force --bind
           Job configuration successfully saved to resources/foo.job.yml
        -  Warn: Failed to complete deployment history version: Fault injected by test.
           Successfully bound job with an id '[FOO_ID]'
         
         >>> bundle generate pipeline --existing-pipeline-id [BAR_ID] --key bar --config-dir exported --source-dir exported-src --force
        @@ -68,12 +63,10 @@
         
         
         >>> bundle deployment unbind bar
        -  Warn: Failed to complete deployment history version: Fault injected by test.
         
         >>> bundle generate pipeline --existing-pipeline-id [BAR_ID] --key bar --config-dir resources --source-dir src --force --bind
           File successfully saved to src/pipeline.sql
           Pipeline configuration successfully saved to resources/bar.pipeline.yml
        -  Warn: Failed to complete deployment history version: Fault injected by test.
           Successfully bound pipeline with an id '[BAR_ID]'
         
         >>> bundle validate
        @@ -87,7 +76,7 @@
         
         >>> bundle deploy --auto-approve
           Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dms-fault-complete_version-commands-[UNIQUE_NAME]/files...
        -  Current Deployment Version: [DATABRICKS_URL]/deployments/[DEPLOYMENT_ID]?version=10
        +  Current Deployment Version: [DATABRICKS_URL]/deployments/[DEPLOYMENT_ID]?version=9
           Updated pipelines.bar
           Files: 6 uploaded, 0 deleted
           Resources: 0 created, 1 changed, 0 deleted, 1 unchanged
        
    acceptance_test.go:1180: 
        LOG.commands: 
        LOG.commands: commands: ('bundle', 'deploy', '--auto-approve')
        LOG.commands: exit=0
        LOG.commands: Uploading bundle files to /Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-e2gwoscsnnb7vpcfpilxqex43m/files...
        LOG.commands: Current Deployment Version: http://127.0.0.1:38761/deployments/4000000000000021?version=1
        LOG.commands: Created pipelines.bar
        LOG.commands: Created jobs.foo
        LOG.commands: Files: 4 uploaded, 0 deleted
        LOG.commands: Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        LOG.commands: 
        LOG.commands: commands: ('workspace', 'get-status', '/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-e2gwoscsnnb7vpcfpilxqex43m/state/resources.deployment.json', '-o', 'json')
        LOG.commands: exit=0
        LOG.commands: {
        LOG.commands:   "object_id": 4000000000000021,
        LOG.commands:   "object_type": "BUNDLE_DEPLOYMENT",
        LOG.commands:   "path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-e2gwoscsnnb7vpcfpilxqex43m/state/resources.deployment.json"
        LOG.commands: }
        LOG.commands: 
        LOG.commands: commands: ('bundle', 'deploy', '--auto-approve')
        LOG.commands: exit=0
        LOG.commands: Uploading bundle files to /Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-e2gwoscsnnb7vpcfpilxqex43m/files...
        LOG.commands: Current Deployment Version: http://127.0.0.1:38761/deployments/4000000000000021?version=2
        LOG.commands: Updated jobs.foo
        LOG.commands: Updated pipelines.bar
        LOG.commands: Files: 3 uploaded, 0 deleted
        LOG.commands: Resources: 0 created, 2 changed, 0 deleted, 0 unchanged
        LOG.commands: Warn: Failed to complete deployment history version: Fault injected by test.
        LOG.commands: 
        LOG.commands: commands: ('jobs', 'get', '8795653346936920445', '-o', 'json')
        LOG.commands: exit=0
        LOG.commands: {
        LOG.commands:   "created_time": 1795653346937,
        LOG.commands:   "creator_user_name": "tester@databricks.com",
        LOG.commands:   "job_id": 8795653346936920445,
        LOG.commands:   "run_as_user_name": "tester@databricks.com",
        LOG.commands:   "settings": {
        LOG.commands:     "deployment": {
        LOG.commands:       "deployment_id": "4000000000000021",
        LOG.commands:       "kind": "BUNDLE",
        LOG.commands:       "metadata_file_path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-e2gwoscsnnb7vpcfpilxqex43m/state/metadata.json",
        LOG.commands:       "version_id": "2"
        LOG.commands:     },
        LOG.commands:     "description": "history-true",
        LOG.commands:     "edit_mode": "UI_LOCKED",
        LOG.commands:     "email_notifications": {},
        LOG.commands:     "format": "MULTI_TASK",
        LOG.commands:     "max_concurrent_runs": 1,
        LOG.commands:     "name": "updated-dms-fault-complete_version-commands-e2gwoscsnnb7vpcfpilxqex43m",
        LOG.commands:     "queue": {
        LOG.commands:       "enabled": true
        LOG.commands:     },
        LOG.commands:     "timeout_seconds": 0,
        LOG.commands:     "webhook_notifications": {}
        LOG.commands:   }
        LOG.commands: }
        LOG.commands: 
        LOG.commands: commands: ('pipelines', 'get', '7a10701e-1f6b-cd6d-7a10-701e1f6bcecf', '-o', 'json')
        LOG.commands: exit=0
        LOG.commands: {
        LOG.commands:   "creator_user_name": "tester@databricks.com",
        LOG.commands:   "effective_publishing_mode": "DEFAULT_PUBLISHING_MODE",
        LOG.commands:   "last_modified": 1795653346933,
        LOG.commands:   "name": "updated-dms-fault-complete_version-commands-e2gwoscsnnb7vpcfpilxqex43m",
        LOG.commands:   "pipeline_id": "7a10701e-1f6b-cd6d-7a10-701e1f6bcecf",
        LOG.commands:   "run_as_user_name": "tester@databricks.com",
        LOG.commands:   "spec": {
        LOG.commands:     "catalog": "main",
        LOG.commands:     "channel": "CURRENT",
        LOG.commands:     "deployment": {
        LOG.commands:       "deployment_id": "4000000000000021",
        LOG.commands:       "kind": "BUNDLE",
        LOG.commands:       "metadata_file_path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-e2gwoscsnnb7vpcfpilxqex43m/state/metadata.json",
        LOG.commands:       "version_id": "2"
        LOG.commands:     },
        LOG.commands:     "edition": "ADVANCED",
        LOG.commands:     "id": "7a10701e-1f6b-cd6d-7a10-701e1f6bcecf",
        LOG.commands:     "libraries": [
        LOG.commands:       {
        LOG.commands:         "file": {
        LOG.commands:           "path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-e2gwoscsnnb7vpcfpilxqex43m/files/pipeline.sql"
        LOG.commands:         }
        LOG.commands:       }
        LOG.commands:     ],
        LOG.commands:     "name": "updated-dms-fault-complete_version-commands-e2gwoscsnnb7vpcfpilxqex43m",
        LOG.commands:     "schema": "default",
        LOG.commands:     "serverless": true
        LOG.commands:   },
        LOG.commands:   "state": "IDLE"
        LOG.commands: }
        LOG.commands: 
        LOG.commands: commands: ('bundle', 'summary')
        LOG.commands: exit=0
        LOG.commands: Name: updated-dms-fault-complete_version-commands-e2gwoscsnnb7vpcfpilxqex43m
        LOG.commands: Target: default
        LOG.commands: Workspace:
        LOG.commands:   User: tester@databricks.com
        LOG.commands:   Path: /Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-e2gwoscsnnb7vpcfpilxqex43m
        LOG.commands: Resources:
        LOG.commands:   Jobs:
        LOG.commands:     foo:
        LOG.commands: ... (540 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)

10 more failure details omitted, see the full report in the run.

@shreyas-goenka
shreyas-goenka force-pushed the shreyas-goenka_data/shreyas-goenka/out-of-band-unbind-history branch from 572ef11 to 1ec93c8 Compare November 19, 2026 16:33
@shreyas-goenka
shreyas-goenka force-pushed the shreyas-goenka_data/shreyas-goenka/out-of-band-unbind-history branch from 1ec93c8 to 31ef70d Compare November 19, 2026 16:49
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 650d05b

Run: 45729036061

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 292 38 4:57
💚​ aws-windows-latest-4core-16gb 1 294 36 5:58
💚​ azure linux-2core-8gb 1 291 38 4:22
💚​ azure-windows-latest-4core-16gb 1 293 36 6:44
💚​ gcp linux-2core-8gb 1 292 38 4:29
💚​ gcp-windows-latest-4core-16gb 1 294 36 7:43
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:57 azure-windows-latest-4core-16gb TestAccept
3:26 aws-windows-latest-4core-16gb TestAccept
3:15 gcp-windows-latest-4core-16gb TestAccept

@shreyas-goenka
shreyas-goenka force-pushed the shreyas-goenka_data/shreyas-goenka/out-of-band-unbind-history branch from 31ef70d to 6a37f55 Compare November 19, 2026 18:32
@shreyas-goenka
shreyas-goenka force-pushed the shreyas-goenka_data/shreyas-goenka/out-of-band-unbind-history branch from 6a37f55 to 2450b54 Compare November 20, 2026 09:50
@shreyas-goenka
shreyas-goenka force-pushed the shreyas-goenka_data/shreyas-goenka/out-of-band-unbind-history branch from 2450b54 to b780176 Compare November 20, 2026 10:17
@shreyas-goenka
shreyas-goenka force-pushed the shreyas-goenka_data/shreyas-goenka/out-of-band-unbind-history branch from b780176 to 69251d6 Compare November 20, 2026 10:38
@shreyas-goenka
shreyas-goenka force-pushed the shreyas-goenka_data/shreyas-goenka/out-of-band-unbind-history branch from 69251d6 to 650d05b Compare November 26, 2026 00:26
@shreyas-goenka
shreyas-goenka marked this pull request as ready for review November 26, 2026 13:36
@shreyas-goenka
shreyas-goenka requested review from a team as code owners November 26, 2026 13:36

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated review at 650d05b. Each finding was verified against the code.

No blocking issues found. 3 non-blocking comment(s) and 1 question(s) below.

This PR records deployment history for bundle deployment unbind. It returns the removed state keys and the committed serial from DeploymentBundle.Unbind, then publishes them as cleared-state operations in a separate binding version, the same way bind records its history. I traced the serial prediction, the empty and missing-key paths and the shadow-feature stamping, and they hold up. What's left is duplicated code with Bind, a comment that doesn't explain the serial bump, and a new test directory that mirrors an existing one. One open question: should DMS be updated before the remote state upload succeeds?

Questions

  1. recordUnbindHistory sends and drains the cleared-state operations as SUCCEEDED before PushResourcesState (bundle/phases/bind.go:200-205). When the upload fails, the version completes with FAILURE, but DMS has probably already dropped jobs.upload_failed, while the remote resources.json still binds it (unbind-upload-failure/output.txt). Is that split intended, as with bind? If so, can the test also show bundle-deployments list-resources after the failure? If not, should the operations be recorded only after the push succeeds? (non-blocking)

Comment thread bundle/direct/bind.go
return err
return nil, err
}
var configured *bool

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nice to have] This block reads configRoot.Experimental.DeploymentHistory and sets FeatureDeploymentHistoryShadow when history is on. It is a copy of lines 116-126 in Bind, so if the rule for when the marker is set changes in one place, bind and unbind will drift apart. Can it move into one helper on DeploymentBundle (or in dstate) that both call?

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.

🤖 Should fix +1, and the two copies have already drifted. Since this PR was cut, #7817 changed Bind's copy to bundleenv.DeploymentHistoryChoice: an explicit setting wins, otherwise the loaded marker decides (c666673). bundleenv.RecordsDeploymentHistory no longer exists on #7817's branch or on main (#7895). So once this PR is rebased (GitHub already reports a conflict), this line stops compiling:

bundle/direct/bind.go:288:45: undefined: bundleenv.RecordsDeploymentHistory

I checked by cherry-picking this commit onto the current #7817 branch and applying Bind's current rule here. It builds, and ./bundle/direct, ./bundle/phases, TestAccept/bundle/dms, TestAccept/bundle/dms_fault and TestAccept/bundle/deployment/(bind|unbind) pass. The only golden changes are version numbers in dms/bind-unbind and dms/unbind-upload-failure, which come from #7817's max(next, serial) change. Moving the block into one helper that Bind and Unbind both call would stop the next change to this rule from missing one of them. The case without an explicit setting is the one whose code changes, so the earlier suggestion on bind-unbind/script line 33 (run this unbind without DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY) would cover it.

Comment thread bundle/direct/bind.go
var metadata *DMSUnbindMetadata
if b.StateDB.RecordsHistory() {
metadata = &DMSUnbindMetadata{Serial: b.StateDB.Data.Serial}
// Finalize commits the removals below as one existing WAL transaction.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] The comment doesn't say why the serial only advances when State != nil. The reason is that DeleteState returns early without a WAL entry when Data.State is nil, and otherwise always appends one, even for a missing key. That entry is what makes mergeWalIntoState advance the serial. Something like "Every DeleteState below appends a WAL entry unless State is nil, so Finalize advances the serial by exactly one" would make the ++ read as intended rather than as a guess about Finalize.

@@ -0,0 +1,15 @@
envsubst < databricks.yml.tmpl > databricks.yml

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nice to have] This script mirrors acceptance/bundle/dms/bind-upload-failure/script almost line for line: the same setup bind, the same fault.py on resources.json, the same musterr, the same //complete check and the same bundle summary projection. Only bind/unbind changes, and test.toml is copied too. .agents/rules/testing.md asks to extend the existing acceptance directory when coverage overlaps. Can the unbind case become an extra titled phase in bind-upload-failure, renamed to cover both?

@Sankalp-Mittal Sankalp-Mittal left a comment

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] Review by review-factory (Claude Opus 5.5 + Claude Sonnet 5.5 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.

No blocking or major issues found.

rm -f "$OUT_REQUESTS"

title "Unbind preserves the shadow history marker and leaves the job intact"
trace $CLI bundle deployment unbind foo

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] This unbind runs with DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY=true, so it passes even if Unbind ignored the loaded shadow marker, and no other test covers that. Clear the variable here, like the rebind at line 47?

@denik denik left a comment

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.

🤖 Automated review of 650d05b by Opus and Astra (two independent Astra passes plus a devil's-advocate pass; Fable was unavailable this round). Each finding was verified against the code.

Verdict: the unbind history path looks right for this diff. It records the parent and its permissions/grants as cleared-state operations, skips the version when nothing was removed, and fails the version when the state upload fails. It needs a rebase onto #7817 first, and after that Unbind has to follow Bind's new history rule to compile (see the thread on bundle/direct/bind.go).

Readiness:

  • Conflicts with its base out-of-band-bind-history (#7817), which has moved on since this PR was cut. CI, regression and integration results are for the old base, so they'll need to run again after the rebase.

Not posted inline:

  1. bundle/phases/bind.go:238: question, not a defect. The API has OPERATION_ACTION_TYPE_UNBIND, but unbind is recorded as OPERATION_ACTION_TYPE_UPDATE with cleared state, so history can't tell an unbind from an update that cleared state. #7817 records bind as UPDATE rather than BIND too. Is that deliberate, for example because the service handles those types differently?
  2. bundle/phases/bind.go:200: +1 to review-oss-bot's question about publishing the removals before PushResourcesState. #7817's bind publishes in the same order, so one decision should cover both commands.

Comment thread bundle/direct/bind.go
return err
return nil, err
}
var configured *bool

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.

🤖 Should fix +1, and the two copies have already drifted. Since this PR was cut, #7817 changed Bind's copy to bundleenv.DeploymentHistoryChoice: an explicit setting wins, otherwise the loaded marker decides (c666673). bundleenv.RecordsDeploymentHistory no longer exists on #7817's branch or on main (#7895). So once this PR is rebased (GitHub already reports a conflict), this line stops compiling:

bundle/direct/bind.go:288:45: undefined: bundleenv.RecordsDeploymentHistory

I checked by cherry-picking this commit onto the current #7817 branch and applying Bind's current rule here. It builds, and ./bundle/direct, ./bundle/phases, TestAccept/bundle/dms, TestAccept/bundle/dms_fault and TestAccept/bundle/deployment/(bind|unbind) pass. The only golden changes are version numbers in dms/bind-unbind and dms/unbind-upload-failure, which come from #7817's max(next, serial) change. Moving the block into one helper that Bind and Unbind both call would stop the next change to this rule from missing one of them. The case without an explicit setting is the one whose code changes, so the earlier suggestion on bind-unbind/script line 33 (run this unbind without DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY) would cover it.

This branch has not been deployed

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

Labels

DABs DABs related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants