Skip to content

Support bundle deployment bind/unbind for DMS-recorded deployments - #6590

Draft
shreyas-goenka wants to merge 2 commits into
mainfrom
isaac/dms-bindunbind
Draft

Support bundle deployment bind/unbind for DMS-recorded deployments#6590
shreyas-goenka wants to merge 2 commits into
mainfrom
isaac/dms-bindunbind

Conversation

@shreyas-goenka

@shreyas-goenka shreyas-goenka commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Changes

databricks bundle deployment bind and unbind now work when the bundle records deployment history (experimental.deployment_history) instead of erroring. They record a bind / unbind operation with the deployment metadata service (DMS). This also enables the DMS variant of the bundle deployment bind/unbind acceptance suites.

Why

For a DMS-recorded deployment the resource state lives in the service, not the state file, so the old code refused. Bind now reuses the engine's file-based bind against a throwaway snapshot of what the service holds (to get the plan preview and resolved state), then records that state as a bind operation so the next deploy sees the resource as managed. Unbind clears the resource and its permissions/grants as unbind operations. Both always complete the version — with failure on a recording error — so a version's lease is never leaked, matching the deploy/destroy paths.

Tests

  • New acceptance/bundle/dms/bind-unbind asserts the recorded bind/unbind action types and that the job is managed after bind and re-created after unbind.
  • New acceptance/bundle/dms/record-op-fault asserts the version is completed with failure when the operation upload fails, rather than left dangling.
  • Removed the blanket EnvMatrix.DMS = [""] opt-out so the bind/unbind suites run under DMS; only the subtests that assert job/pipeline deployment stamps or dumped state (engine-level differences) stay opted out.

This pull request and its description were written by Isaac.

Bind and unbind now record their change with the deployment metadata
service instead of refusing when experimental.deployment_history is on,
using bind/unbind operation action types. Enables the DMS variant for the
bind/unbind acceptance tests; the few that assert job/pipeline deployment
stamps or dumped state stay opted out.

Co-authored-by: Isaac <no-reply@databricks.com>
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 3f9074a

Run: 34411535353

Env ❌​FAIL 🟨​KNOWN ✅​pass 🙈​skip Time
❌​ aws linux 38 1 307 34 7:36
❌​ aws windows 38 1 309 32 13:22
❌​ azure linux 38 1 306 34 12:31
❌​ azure windows 40 1 306 32 14:34
❌​ gcp linux 38 1 307 34 10:26
❌​ gcp windows 38 1 309 32 15:58
41 interesting tests: 40 FAIL, 1 KNOWN
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K
❌​ TestAccept/bundle/deployment/bind/alert ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/alert/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/catalog ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/catalog/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/cluster ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/cluster/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/dashboard ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/dashboard/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/READPLAN= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/dashboard/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/READPLAN=1 ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/dashboard/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true/READPLAN= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/dashboard/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true/READPLAN=1 ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/dashboard/DATABRICKS_BUNDLE_ENGINE=terraform/DMS=/READPLAN= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/dashboard/recreation ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/dashboard/recreation/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/READPLAN= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/dashboard/recreation/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/READPLAN=1 ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/dashboard/recreation/DATABRICKS_BUNDLE_ENGINE=terraform/DMS=/READPLAN= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/experiment ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/experiment/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/job/job-spark-python-task ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/job/job-spark-python-task/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/model-serving-endpoint ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/model-serving-endpoint/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/registered-model ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/registered-model/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/schema ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/schema/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/secret-scope ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/secret-scope/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/vector_search_endpoint ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/vector_search_endpoint/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/volume ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/bind/volume/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/unbind/grants ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/unbind/grants/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/unbind/permissions ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/deployment/unbind/permissions/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/dms/bind-unbind ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/dms/bind-unbind/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestFsCpFileToFileWithOverwriteFlag ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsCpFileToFileWithOverwriteFlag/local_to_uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
Top 1 slowest tests (at least 2 minutes):
duration env testname
2:09 azure windows TestAccept/bundle/deployment/bind/job/generate-and-bind/DATABRICKS_BUNDLE_ENGINE=terraform/DMS=

- Always complete the DMS version (with failure on error) after starting it,
  so a bind/unbind recording failure does not leak the version's lease, matching
  the deploy and destroy paths.
- FetchDeployment now returns the parsed last version id, dropping the duplicate
  parse in phases and process.go, and keeps the half-created-deployment TODO that
  was dropped when it moved to libs/dms.
- Extract openRecordedState and tighten comments.
- New bundle/dms/record-op-fault test asserts the version completes with failure
  when the operation upload fails; bundle/dms/bind-unbind now cleans up and
  asserts the resource is managed after bind and re-created after unbind.

Co-authored-by: Isaac <no-reply@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants