Skip to content

Record bind history outside StateDB - #7817

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

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

Conversation

@shreyas-goenka

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

Copy link
Copy Markdown
Contributor

Changes

Record committed bundle deployment bind operations as UPDATE in deployment history. Recording is best effort and runs separately from StateDB, after approval and the existing temporary-file commit.

Why

Bind changes resource state without recording history today. This preserves the existing preparation flow, two state writes, and serial increments. Bind omits uploaded-file metadata; existing deployment metadata is preserved.

Stacked on #7816.

Tests

  • Existing bind routes, immutable bind, and cancellation coverage.
  • Existing DMS fault tests verify remote state after bind.
  • A focused upload-failure case verifies the command/version fail and remote file state stays unchanged.

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-bind-history branch from a99be74 to e02cd13 Compare November 19, 2026 16:19
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 40d560dd9 | Workflow run

Regression test report

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

26 tests: regression=16 unreleased=0 coverage=10 failing=0
test branch main (f4a7fe5) latest (v1.27.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_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/dms_fault/list_resources/DMS=true ✅ ❌ ❌
TestAccept/bundle/deployment/bind/feature_spec/DMS=true/OUTPUT_MODE=recorded: branch ✅ | main (f4a7fe5) ❌ | latest (v1.27.0) ❌

main (f4a7fe5):

acceptance_test.go:1400: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1400
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1153
        	            				/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_M1517671895/001/out.bind.recorded.txt
    acceptance_test.go:1178: 
        LOG.cleanup: All files and directories at the following location will be deleted: /Workspace/Users/tester@databricks.com/.bundle/test-bind-feature-spec-2zgfxjcgrjabdggrly7uryc5ue/default
        LOG.cleanup: 
        LOG.cleanup: Destroy: 0 deleted

latest (v1.27.0):

acceptance_test.go:1400: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1400
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1153
        	            				/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_M3531711161/001/out.bind.recorded.txt
    acceptance_test.go:1178: 
        LOG.cleanup: All files and directories at the following location will be deleted: /Workspace/Users/tester@databricks.com/.bundle/test-bind-feature-spec-oiov4qgezraifcrso4yag7eeam/default
        LOG.cleanup: 
        LOG.cleanup: Destroy: 0 deleted
FAIL
TestAccept/bundle/dms/bind-immutable/DMS=true: branch ✅ | main (f4a7fe5) ❌ | latest (v1.27.0) ❌

main (f4a7fe5):

acceptance_test.go:1400: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1400
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1141
        	            				/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"
        	            	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,11 +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
        	            	 
        	Test:       	TestAccept/bundle/dms/bind-immutable/DMS=true
        	Messages:   	bundle/dms/bind-immutable/output.txt vs /tmp/TestAcceptbundledmsbind-immutableDMS=true3188767492/002/output.txt

latest (v1.27.0): same output as main (f4a7fe5)

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

main (f4a7fe5):

acceptance_test.go:1400: Diff:
        --- bundle/dms/bind-unbind/output.txt
        +++ /tmp/TestAcceptbundledmsbind-unbindDMS=true3470909696/002/output.txt
        @@ -24,105 +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...
        -Updated jobs.foo
        -Files: 2 uploaded, 0 deleted
        -Resources: 0 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
        -
        ->>> jq {features, state} .databricks/bundle/default/resources.json
        -{
        -  "features": {
        -    "deployment_history_shadow": {}
        -  },
        -  "state": {}
        -}
        -
        ->>> [CLI] jobs get [JOB_ID]
        -{
        -  "job_id": [JOB_ID]
        -}
        -
        -=== 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": "7"}, "body": {"cli_version": "[CLI_VERSION]", "operations": [{"action_type": "OPERATION_ACTION_TYPE_UPDATE", "resource_key": "jobs.foo"}], "previous_version_id": "4", "version_type": "VERSION_TYPE_DEPLOY"}}
        -{"method": "PATCH", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/7/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/7/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...
        -Files: 0 uploaded, 0 deleted
        -Resources: 0 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:1178: 
        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-whhjnvsb3ffh3blntq7ayoovuy/default
        LOG.cleanup: 
        LOG.cleanup: Destroy: 1 deleted
        LOG.cleanup: Error: Not Found
        LOG.cleanup: 
        LOG.cleanup: Exit code: 1

latest (v1.27.0):

acceptance_test.go:1400: Diff:
        --- bundle/dms/bind-unbind/output.txt
        +++ /tmp/TestAcceptbundledmsbind-unbindDMS=true1346464154/002/output.txt
        @@ -24,105 +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...
        -Updated jobs.foo
        -Files: 2 uploaded, 0 deleted
        -Resources: 0 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
        -
        ->>> jq {features, state} .databricks/bundle/default/resources.json
        -{
        -  "features": {
        -    "deployment_history_shadow": {}
        -  },
        -  "state": {}
        -}
        -
        ->>> [CLI] jobs get [JOB_ID]
        -{
        -  "job_id": [JOB_ID]
        -}
        -
        -=== 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": "7"}, "body": {"cli_version": "[CLI_VERSION]", "operations": [{"action_type": "OPERATION_ACTION_TYPE_UPDATE", "resource_key": "jobs.foo"}], "previous_version_id": "4", "version_type": "VERSION_TYPE_DEPLOY"}}
        -{"method": "PATCH", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/7/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/7/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...
        -Files: 0 uploaded, 0 deleted
        -Resources: 0 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:1178: 
        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-pp4snppwubbfbkwzzowtgvnzze/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 (f4a7fe5) ❌ | latest (v1.27.0) ❌

main (f4a7fe5):

acceptance_test.go:1400: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1400
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1141
        	            				/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=true2184254320/002/output.txt
    acceptance_test.go:1178: 
        LOG.setup: Successfully bound job with an id '8795171578767260355'
        LOG.setup: Run 'bundle deploy' to deploy changes to your workspace

latest (v1.27.0):

acceptance_test.go:1400: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1400
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1141
        	            				/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=true1545504960/002/output.txt
    acceptance_test.go:1178: 
        LOG.setup: Successfully bound job with an id '8795171622638606438'
        LOG.setup: Run 'bundle deploy' to deploy changes to your workspace
TestAccept/bundle/dms_fault/complete_version/DMS=true: branch ✅ | main (f4a7fe5) ❌ | latest (v1.27.0) ❌

main (f4a7fe5):

acceptance_test.go:1400: Diff:
        --- bundle/dms_fault/complete_version/output.txt
        +++ /tmp/TestAcceptbundledms_faultcomplete_versionDMS=true630142255/002/output.txt
        @@ -51,7 +51,6 @@
         
         >>> 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
        @@ -71,7 +70,6 @@
         >>> 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
        @@ -85,7 +83,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:1178: 
        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-dphcqc4bv5egzjgwqfbxumpd34/files...
        LOG.commands: Current Deployment Version: http://127.0.0.1:44097/deployments/4000000000000329?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-dphcqc4bv5egzjgwqfbxumpd34/state/resources.deployment.json', '-o', 'json')
        LOG.commands: exit=0
        LOG.commands: {
        LOG.commands:   "object_id": 4000000000000329,
        LOG.commands:   "object_type": "BUNDLE_DEPLOYMENT",
        LOG.commands:   "path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-dphcqc4bv5egzjgwqfbxumpd34/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-dphcqc4bv5egzjgwqfbxumpd34/files...
        LOG.commands: Current Deployment Version: http://127.0.0.1:44097/deployments/4000000000000329?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', '8795171578820260526', '-o', 'json')
        LOG.commands: exit=0
        LOG.commands: {
        LOG.commands:   "created_time": 1795171578820,
        LOG.commands:   "creator_user_name": "tester@databricks.com",
        LOG.commands:   "job_id": 8795171578820260526,
        LOG.commands:   "run_as_user_name": "tester@databricks.com",
        LOG.commands:   "settings": {
        LOG.commands:     "deployment": {
        LOG.commands:       "deployment_id": "4000000000000329",
        LOG.commands:       "kind": "BUNDLE",
        LOG.commands:       "metadata_file_path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-dphcqc4bv5egzjgwqfbxumpd34/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-dphcqc4bv5egzjgwqfbxumpd34",
        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', '7a0eb9f3-be0e-7fc4-7a0e-b9f3be0e80f0', '-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": 1795171578817,
        LOG.commands:   "name": "updated-dms-fault-complete_version-commands-dphcqc4bv5egzjgwqfbxumpd34",
        LOG.commands:   "pipeline_id": "7a0eb9f3-be0e-7fc4-7a0e-b9f3be0e80f0",
        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": "4000000000000329",
        LOG.commands:       "kind": "BUNDLE",
        LOG.commands:       "metadata_file_path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-dphcqc4bv5egzjgwqfbxumpd34/state/metadata.json",
        LOG.commands:       "version_id": "2"
        LOG.commands:     },
        LOG.commands:     "edition": "ADVANCED",
        LOG.commands:     "id": "7a0eb9f3-be0e-7fc4-7a0e-b9f3be0e80f0",
        LOG.commands:     "libraries": [
        LOG.commands:       {
        LOG.commands:         "file": {
        LOG.commands:           "path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-dphcqc4bv5egzjgwqfbxumpd34/files/pipeline.sql"
        LOG.commands:         }
        LOG.commands:       }
        LOG.commands:     ],
        LOG.commands:     "name": "updated-dms-fault-complete_version-commands-dphcqc4bv5egzjgwqfbxumpd34",
        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-dphcqc4bv5egzjgwqfbxumpd34
        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-dphcqc4bv5egzjgwqfbxumpd34
        LOG.commands: Resources:
        LOG.commands:   Jobs:
        LOG.commands:     foo:
        LOG.commands: ... (470 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)

latest (v1.27.0):

acceptance_test.go:1400: Diff:
        --- bundle/dms_fault/complete_version/output.txt
        +++ /tmp/TestAcceptbundledms_faultcomplete_versionDMS=true646776917/002/output.txt
        @@ -51,7 +51,6 @@
         
         >>> 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
        @@ -71,7 +70,6 @@
         >>> 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
        @@ -85,7 +83,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:1178: 
        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-px75eotvhjcydmhpj7yaecnvl4/files...
        LOG.commands: Current Deployment Version: http://127.0.0.1:44269/deployments/4000000000001090?version=1
        LOG.commands: Created jobs.foo
        LOG.commands: Created pipelines.bar
        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-px75eotvhjcydmhpj7yaecnvl4/state/resources.deployment.json', '-o', 'json')
        LOG.commands: exit=0
        LOG.commands: {
        LOG.commands:   "object_id": 4000000000001090,
        LOG.commands:   "object_type": "BUNDLE_DEPLOYMENT",
        LOG.commands:   "path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-px75eotvhjcydmhpj7yaecnvl4/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-px75eotvhjcydmhpj7yaecnvl4/files...
        LOG.commands: Current Deployment Version: http://127.0.0.1:44269/deployments/4000000000001090?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', '8795171620415214588', '-o', 'json')
        LOG.commands: exit=0
        LOG.commands: {
        LOG.commands:   "created_time": 1795171620415,
        LOG.commands:   "creator_user_name": "tester@databricks.com",
        LOG.commands:   "job_id": 8795171620415214588,
        LOG.commands:   "run_as_user_name": "tester@databricks.com",
        LOG.commands:   "settings": {
        LOG.commands:     "deployment": {
        LOG.commands:       "deployment_id": "4000000000001090",
        LOG.commands:       "kind": "BUNDLE",
        LOG.commands:       "metadata_file_path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-px75eotvhjcydmhpj7yaecnvl4/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-px75eotvhjcydmhpj7yaecnvl4",
        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', '7a0eb9fd-6d66-3aa5-7a0e-b9fd6d663bc8', '-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": 1795171620414,
        LOG.commands:   "name": "updated-dms-fault-complete_version-commands-px75eotvhjcydmhpj7yaecnvl4",
        LOG.commands:   "pipeline_id": "7a0eb9fd-6d66-3aa5-7a0e-b9fd6d663bc8",
        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": "4000000000001090",
        LOG.commands:       "kind": "BUNDLE",
        LOG.commands:       "metadata_file_path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-px75eotvhjcydmhpj7yaecnvl4/state/metadata.json",
        LOG.commands:       "version_id": "2"
        LOG.commands:     },
        LOG.commands:     "edition": "ADVANCED",
        LOG.commands:     "id": "7a0eb9fd-6d66-3aa5-7a0e-b9fd6d663bc8",
        LOG.commands:     "libraries": [
        LOG.commands:       {
        LOG.commands:         "file": {
        LOG.commands:           "path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-complete_version-commands-px75eotvhjcydmhpj7yaecnvl4/files/pipeline.sql"
        LOG.commands:         }
        LOG.commands:       }
        LOG.commands:     ],
        LOG.commands:     "name": "updated-dms-fault-complete_version-commands-px75eotvhjcydmhpj7yaecnvl4",
        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-px75eotvhjcydmhpj7yaecnvl4
        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-px75eotvhjcydmhpj7yaecnvl4
        LOG.commands: Resources:
        LOG.commands:   Jobs:
        LOG.commands:     foo:
        LOG.commands: ... (470 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)
TestAccept/bundle/dms_fault/create_deployment/DMS=true: branch ✅ | main (f4a7fe5) ❌ | latest (v1.27.0) ❌

main (f4a7fe5):

acceptance_test.go:1400: Diff:
        --- bundle/dms_fault/create_deployment/output.txt
        +++ /tmp/TestAcceptbundledms_faultcreate_deploymentDMS=true3109460411/002/output.txt
        @@ -42,7 +42,6 @@
         
         >>> 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 record deployment history for bind: failed to create deployment: 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
        @@ -62,7 +61,6 @@
         >>> 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 record deployment history for bind: failed to create deployment: Fault injected by test.
           Successfully bound pipeline with an id '[BAR_ID]'
         
         >>> bundle validate
        
    acceptance_test.go:1178: 
        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-create_deployment-commands-qpqjqjtikrcsrp5g5umltukfja/files...
        LOG.commands: Warn: Could not enable deployment history for this deploy: failed to create deployment: Fault injected by test.
        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: ('jobs', 'get', '8795171573825812027', '-o', 'json')
        LOG.commands: exit=0
        LOG.commands: {
        LOG.commands:   "created_time": 1795171573826,
        LOG.commands:   "creator_user_name": "tester@databricks.com",
        LOG.commands:   "job_id": 8795171573825812027,
        LOG.commands:   "run_as_user_name": "tester@databricks.com",
        LOG.commands:   "settings": {
        LOG.commands:     "deployment": {
        LOG.commands:       "kind": "BUNDLE",
        LOG.commands:       "metadata_file_path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-create_deployment-commands-qpqjqjtikrcsrp5g5umltukfja/state/metadata.json",
        LOG.commands:       "version_id": "1"
        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-create_deployment-commands-qpqjqjtikrcsrp5g5umltukfja",
        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', '7a0eb9f2-9473-b727-7a0e-b9f29473b85d', '-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": 1795171573824,
        LOG.commands:   "name": "updated-dms-fault-create_deployment-commands-qpqjqjtikrcsrp5g5umltukfja",
        LOG.commands:   "pipeline_id": "7a0eb9f2-9473-b727-7a0e-b9f29473b85d",
        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:       "kind": "BUNDLE",
        LOG.commands:       "metadata_file_path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-create_deployment-commands-qpqjqjtikrcsrp5g5umltukfja/state/metadata.json",
        LOG.commands:       "version_id": "1"
        LOG.commands:     },
        LOG.commands:     "edition": "ADVANCED",
        LOG.commands:     "id": "7a0eb9f2-9473-b727-7a0e-b9f29473b85d",
        LOG.commands:     "libraries": [
        LOG.commands:       {
        LOG.commands:         "file": {
        LOG.commands:           "path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-create_deployment-commands-qpqjqjtikrcsrp5g5umltukfja/files/pipeline.sql"
        LOG.commands:         }
        LOG.commands:       }
        LOG.commands:     ],
        LOG.commands:     "name": "updated-dms-fault-create_deployment-commands-qpqjqjtikrcsrp5g5umltukfja",
        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-create_deployment-commands-qpqjqjtikrcsrp5g5umltukfja
        LOG.commands: Target: default
        LOG.commands: Workspace:
        LOG.commands:   User: tester@databricks.com
        LOG.commands:   Path: /Workspace/Users/tester@databricks.com/.bundle/dms-fault-create_deployment-commands-qpqjqjtikrcsrp5g5umltukfja
        LOG.commands: Resources:
        LOG.commands:   Jobs:
        LOG.commands:     foo:
        LOG.commands:       Name: updated-dms-fault-create_deployment-commands-qpqjqjtikrcsrp5g5umltukfja
        LOG.commands:       URL:  http://127.0.0.1:45503/jobs/8795171573825812027?w=900800700600
        LOG.commands:   Pipelines:
        LOG.commands:     bar:
        LOG.commands:       Name: updated-dms-fault-create_deployment-commands-qpqjqjtikrcsrp5g5umltukfja
        LOG.commands:       URL:  http://127.0.0.1:45503/pipelines/7a0eb9f2-9473-b727-7a0e-b9f29473b85d?w=900800700600
        LOG.commands: 
        LOG.commands: commands: ('bundle', 'generate', 'job', '--existing-job-id', '8795171573825812027', '--key', 'foo', '--config-dir', 'exported', '--source-dir', 'exported-src', '--force')
        LOG.commands: exit=0
        LOG.commands: Job configuration successfully saved to exported/foo.job.yml
        LOG.commands: Warning: Generated configuration is not included in the bundle
        LOG.commands: 
        LOG.commands: The file exported/foo.job.yml is not matched by any pattern in the 'include' section of databricks.yml,
        LOG.commands: so it will not be deployed. Add a matching entry to the 'include' section, for example:
        LOG.commands: 
        LOG.commands: include:
        LOG.commands:   - exported/*.yml
        LOG.commands: 
        LOG.commands: 
        LOG.commands: commands: ('bundle', 'deployment', 'unbind', 'foo')
        LOG.commands: ... (443 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)

latest (v1.27.0):

acceptance_test.go:1400: Diff:
        --- bundle/dms_fault/create_deployment/output.txt
        +++ /tmp/TestAcceptbundledms_faultcreate_deploymentDMS=true2529701202/002/output.txt
        @@ -42,7 +42,6 @@
         
         >>> 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 record deployment history for bind: failed to create deployment: 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
        @@ -62,7 +61,6 @@
         >>> 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 record deployment history for bind: failed to create deployment: Fault injected by test.
           Successfully bound pipeline with an id '[BAR_ID]'
         
         >>> bundle validate
        
    acceptance_test.go:1178: 
        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-create_deployment-commands-noi6zewzknet7avi7im5ypk4yq/files...
        LOG.commands: Warn: Could not enable deployment history for this deploy: failed to create deployment: Fault injected by test.
        LOG.commands: Created jobs.foo
        LOG.commands: Created pipelines.bar
        LOG.commands: Files: 4 uploaded, 0 deleted
        LOG.commands: Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        LOG.commands: 
        LOG.commands: commands: ('jobs', 'get', '8795171620087959965', '-o', 'json')
        LOG.commands: exit=0
        LOG.commands: {
        LOG.commands:   "created_time": 1795171620088,
        LOG.commands:   "creator_user_name": "tester@databricks.com",
        LOG.commands:   "job_id": 8795171620087959965,
        LOG.commands:   "run_as_user_name": "tester@databricks.com",
        LOG.commands:   "settings": {
        LOG.commands:     "deployment": {
        LOG.commands:       "kind": "BUNDLE",
        LOG.commands:       "metadata_file_path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-create_deployment-commands-noi6zewzknet7avi7im5ypk4yq/state/metadata.json",
        LOG.commands:       "version_id": "1"
        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-create_deployment-commands-noi6zewzknet7avi7im5ypk4yq",
        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', '7a0eb9fd-5a11-dfb3-7a0e-b9fd5a11e085', '-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": 1795171620090,
        LOG.commands:   "name": "updated-dms-fault-create_deployment-commands-noi6zewzknet7avi7im5ypk4yq",
        LOG.commands:   "pipeline_id": "7a0eb9fd-5a11-dfb3-7a0e-b9fd5a11e085",
        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:       "kind": "BUNDLE",
        LOG.commands:       "metadata_file_path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-create_deployment-commands-noi6zewzknet7avi7im5ypk4yq/state/metadata.json",
        LOG.commands:       "version_id": "1"
        LOG.commands:     },
        LOG.commands:     "edition": "ADVANCED",
        LOG.commands:     "id": "7a0eb9fd-5a11-dfb3-7a0e-b9fd5a11e085",
        LOG.commands:     "libraries": [
        LOG.commands:       {
        LOG.commands:         "file": {
        LOG.commands:           "path": "/Workspace/Users/tester@databricks.com/.bundle/dms-fault-create_deployment-commands-noi6zewzknet7avi7im5ypk4yq/files/pipeline.sql"
        LOG.commands:         }
        LOG.commands:       }
        LOG.commands:     ],
        LOG.commands:     "name": "updated-dms-fault-create_deployment-commands-noi6zewzknet7avi7im5ypk4yq",
        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-create_deployment-commands-noi6zewzknet7avi7im5ypk4yq
        LOG.commands: Target: default
        LOG.commands: Workspace:
        LOG.commands:   User: tester@databricks.com
        LOG.commands:   Path: /Workspace/Users/tester@databricks.com/.bundle/dms-fault-create_deployment-commands-noi6zewzknet7avi7im5ypk4yq
        LOG.commands: Resources:
        LOG.commands:   Jobs:
        LOG.commands:     foo:
        LOG.commands:       Name: updated-dms-fault-create_deployment-commands-noi6zewzknet7avi7im5ypk4yq
        LOG.commands:       URL:  http://127.0.0.1:43963/jobs/8795171620087959965?w=900800700600
        LOG.commands:   Pipelines:
        LOG.commands:     bar:
        LOG.commands:       Name: updated-dms-fault-create_deployment-commands-noi6zewzknet7avi7im5ypk4yq
        LOG.commands:       URL:  http://127.0.0.1:43963/pipelines/7a0eb9fd-5a11-dfb3-7a0e-b9fd5a11e085?w=900800700600
        LOG.commands: 
        LOG.commands: commands: ('bundle', 'generate', 'job', '--existing-job-id', '8795171620087959965', '--key', 'foo', '--config-dir', 'exported', '--source-dir', 'exported-src', '--force')
        LOG.commands: exit=0
        LOG.commands: Job configuration successfully saved to exported/foo.job.yml
        LOG.commands: Warning: Generated configuration is not included in the bundle
        LOG.commands: 
        LOG.commands: The file exported/foo.job.yml is not matched by any pattern in the 'include' section of databricks.yml,
        LOG.commands: so it will not be deployed. Add a matching entry to the 'include' section, for example:
        LOG.commands: 
        LOG.commands: include:
        LOG.commands:   - exported/*.yml
        LOG.commands: 
        LOG.commands: 
        LOG.commands: commands: ('bundle', 'deployment', 'unbind', 'foo')
        LOG.commands: ... (443 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-bind-history branch 2 times, most recently from 1841b1a to fbccb43 Compare November 19, 2026 16:48
@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 40d560d

Run: 44720991504

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 285 37 4:37
💚​ aws-windows-latest-4core-16gb 1 287 35 4:39
💚​ azure linux-2core-8gb 1 284 37 4:04
💚​ azure-windows-latest-4core-16gb 1 286 35 5:35
💚​ gcp linux-2core-8gb 1 285 37 4:21
💚​ gcp-windows-latest-4core-16gb 1 287 35 4:42
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
4:16 azure-windows-latest-4core-16gb TestAccept
3:28 gcp-windows-latest-4core-16gb TestAccept
3:20 aws-windows-latest-4core-16gb TestAccept

@shreyas-goenka
shreyas-goenka force-pushed the shreyas-goenka_data/shreyas-goenka/out-of-band-bind-history branch from fbccb43 to 51ec50c Compare November 19, 2026 18:32
@@ -0,0 +1,5 @@

>>> [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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm taking a look whether we need to add feature_spec as a resource to DMS.

@shreyas-goenka
shreyas-goenka force-pushed the shreyas-goenka_data/shreyas-goenka/out-of-band-bind-history branch from 51ec50c to c2454aa Compare November 20, 2026 09:50
$CLI bundle deployment bind kept "$job_id" --auto-approve &> LOG.setup
rm -f "$OUT_REQUESTS"

title "A remote state upload failure fails the bind version"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because of API failing, the remote deployment state is not updated. In this case, deployment history does capture the bind operation but marks it as a failed version.

@shreyas-goenka
shreyas-goenka force-pushed the shreyas-goenka_data/shreyas-goenka/out-of-band-bind-history branch from c2454aa to 365bce7 Compare November 20, 2026 10:17
@shreyas-goenka
shreyas-goenka force-pushed the shreyas-goenka_data/shreyas-goenka/out-of-band-bind-history branch from 365bce7 to 40d560d Compare November 20, 2026 10:38
@shreyas-goenka
shreyas-goenka marked this pull request as ready for review November 20, 2026 10:39
@shreyas-goenka
shreyas-goenka requested review from a team as code owners November 20, 2026 10:39
@shreyas-goenka

Copy link
Copy Markdown
Contributor Author

/review

@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 40d560d. Each finding was verified against the code.

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

This PR records committed bundle deployment bind operations as UPDATE versions in deployment history (DMS), running outside the StateDB. The implementation is correct: it creates a history version after bind commits, completes it after the remote state upload, handles failures gracefully with best-effort semantics, and has thorough fault-injection test coverage. The main concern is that createBindingVersion closely replicates DMS protocol logic already in dms.go, creating a maintenance risk.

Comment thread bundle/phases/bind.go
}

// createBindingVersion claims a history version for the staged binding operations.
func createBindingVersion(ctx context.Context, b *bundle.Bundle, serial int, staged []bundledeployments.StagedOperation) (*bindingHistory, error) {

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] createBindingVersion re-implements the create-deployment-if-absent block (lines 237–251, including the recoverCreatedDeployment fallback and DeploymentIDFromName extraction) and the git-info + CreateVersion construction (lines 255–270) that already live in createOrUpdateDeployment (dms.go:83–98) and startVersion (dms.go:220–241). A protocol change—say a new field on CreateVersion or a tweaked recovery rule—now needs updating in both places. Can you extract at least the "ensure deployment exists" block and the version-info builder into shared helpers that both paths call?

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.

2 participants