Skip to content

Capture implicit UC dependencies in lifecycle.depends_on - #7132

Draft
denik wants to merge 3 commits into
mainfrom
capture-uc-depends-on
Draft

denik wants to merge 3 commits into
mainfrom
capture-uc-depends-on

Conversation

@denik

@denik denik commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Changes

CaptureUCDependencies no longer rewrites a literal schema_name/catalog_name into ${resources.schemas.X.name} just to order a resource after the schema or catalog it names. It adds lifecycle.depends_on instead, so field values stay literal.

The reference also carried the schema's final name, which presets change in development mode. ApplyPresets now prefixes the schema name in the dependents too, using the same matching.

Follows #7120 (lifecycle.depends_on) and #7128 (Resources.ResolveKey).

This pull request and its description were written by Isaac.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 1965104c8 | Workflow run

Regression test report

Selected 11 changed tests (limit=20, 0 not selected)

21 tests: regression=21 unreleased=0 coverage=0 failing=0

test branch main (35ed095) latest (v1.22.1)
TestAccept/bundle/migrate/command/grants/DMS= ✅ ❌ ❌
TestAccept/bundle/resource_deps/computed_volume_path/DMS= ✅ ❌ ❌
TestAccept/bundle/resource_deps/computed_volume_path/DMS=true ✅ ❌ ❌
TestAccept/bundle/resource_deps/implicit_deps_model_serving_endpoint/DMS= ✅ ❌ ❌
TestAccept/bundle/resource_deps/implicit_deps_model_serving_endpoint/DMS=true ✅ ❌ ❌
TestAccept/bundle/resource_deps/implicit_deps_quality_monitor/DMS= ✅ ❌ ❌
TestAccept/bundle/resource_deps/implicit_deps_quality_monitor/DMS=true ✅ ❌ ❌
TestAccept/bundle/resource_deps/implicit_deps_registered_model/DMS= ✅ ❌ ❌
TestAccept/bundle/resource_deps/implicit_deps_registered_model/DMS=true ✅ ❌ ❌
TestAccept/bundle/resource_deps/implicit_deps_vector_search_index/DMS= ✅ ❌ ❌
TestAccept/bundle/resource_deps/implicit_deps_vector_search_index/DMS=true ✅ ❌ ❌
TestAccept/bundle/resource_deps/implicit_deps_volume/DMS= ✅ ❌ ❌
TestAccept/bundle/resource_deps/implicit_deps_volume/DMS=true ✅ ❌ ❌
TestAccept/bundle/resource_deps/remote_field_storage_location/DMS= ✅ ❌ ❌
TestAccept/bundle/resource_deps/remote_field_storage_location/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/grants/registered_models/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/grants/registered_models/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/grants/volumes/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/grants/volumes/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/volumes/catalog-var-ref/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/volumes/catalog-var-ref/DMS=true ✅ ❌ ❌
TestAccept/bundle/migrate/command/grants/DMS=: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/migrate/command/grants/out.new_state.json
        +++ /tmp/TestAcceptbundlemigratecommandgrantsDMS=1565021153/001/out.new_state.json
        @@ -80,7 +80,7 @@
            "depends_on": [
             {
              "node": "resources.schemas.my_schema",
        -     "label": "depends_on"
        +     "label": "${resources.schemas.my_schema.name}"
             }
            ]
           },
        
    acceptance_test.go:1119: 
        LOG.requests_deploy.txt: "cli/1.23.0-dev databricks-sdk-go/0.191.0 go/1.27.3 os/linux cmd/bundle_deploy cmd-exec-id/78bd6ade-d3aa-4ee3-9bf6-120b2e12c9d8 interactive/none engine/direct lineage/B7WAfp5eyKY auth/pat cicd/github"
        LOG.requests_deploy.txt: "cli/1.23.0-dev databricks-sdk-go/0.191.0 go/1.27.3 os/linux cmd/bundle_deploy cmd-exec-id/78bd6ade-d3aa-4ee3-9bf6-120b2e12c9d8 interactive/none engine/direct lineage/B7WAfp5eyKY auth/pat cicd/github"
        LOG.requests_deploy.txt: "cli/1.23.0-dev databricks-sdk-go/0.191.0 go/1.27.3 os/linux cmd/bundle_deploy cmd-exec-id/78bd6ade-d3aa-4ee3-9bf6-120b2e12c9d8 interactive/none engine/direct lineage/B7WAfp5eyKY auth/pat cicd/github"

latest (v1.22.1):

acceptance_test.go:1341: Diff:
        --- bundle/migrate/command/grants/out.new_state.json
        +++ /tmp/TestAcceptbundlemigratecommandgrantsDMS=4269157241/001/out.new_state.json
        @@ -80,7 +80,7 @@
            "depends_on": [
             {
              "node": "resources.schemas.my_schema",
        -     "label": "depends_on"
        +     "label": "${resources.schemas.my_schema.name}"
             }
            ]
           },
        
    acceptance_test.go:1119: 
        LOG.requests_deploy.txt: "cli/1.22.1 databricks-sdk-go/0.189.0 go/1.27.3 os/linux cmd/bundle_deploy cmd-exec-id/ccf5d952-cd6b-40e7-9a66-ff562455a548 interactive/none engine/direct lineage/B7WAfp5eyKY auth/pat cicd/github"
        LOG.requests_deploy.txt: "cli/1.22.1 databricks-sdk-go/0.189.0 go/1.27.3 os/linux cmd/bundle_deploy cmd-exec-id/ccf5d952-cd6b-40e7-9a66-ff562455a548 interactive/none engine/direct lineage/B7WAfp5eyKY auth/pat cicd/github"
        LOG.requests_deploy.txt: "cli/1.22.1 databricks-sdk-go/0.189.0 go/1.27.3 os/linux cmd/bundle_deploy cmd-exec-id/ccf5d952-cd6b-40e7-9a66-ff562455a548 interactive/none engine/direct lineage/B7WAfp5eyKY auth/pat cicd/github"
TestAccept/bundle/resource_deps/computed_volume_path/DMS=: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/resource_deps/computed_volume_path/output.txt
        +++ /tmp/TestAcceptbundleresource_depscomputed_volume_pathDMS=3713173974/002/output.txt
        @@ -10,30 +10,16 @@
           "volumes": {
             "bar": {
               "catalog_name": "main",
        -      "lifecycle": {
        -        "depends_on": [
        -          {
        -            "resource": "schemas.my"
        -          }
        -        ]
        -      },
               "name": "volumebar-[UNIQUE_NAME]",
        -      "schema_name": "myschema-[UNIQUE_NAME]",
        +      "schema_name": "${resources.schemas.my.name}",
               "volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumebar-[UNIQUE_NAME]",
               "volume_type": "MANAGED"
             },
             "foo": {
               "catalog_name": "main",
               "comment": "/Volumes/main/myschema-[UNIQUE_NAME]/volumebar-[UNIQUE_NAME]",
        -      "lifecycle": {
        -        "depends_on": [
        -          {
        -            "resource": "schemas.my"
        -          }
        -        ]
        -      },
               "name": "volumefoo-[UNIQUE_NAME]",
        -      "schema_name": "myschema-[UNIQUE_NAME]",
        +      "schema_name": "${resources.schemas.my.name}",
               "volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumefoo-[UNIQUE_NAME]",
               "volume_type": "MANAGED"
             }

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resource_deps/computed_volume_path/DMS=true: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/resource_deps/computed_volume_path/output.txt
        +++ /tmp/TestAcceptbundleresource_depscomputed_volume_pathDMS=true1494476868/002/output.txt
        @@ -10,30 +10,16 @@
           "volumes": {
             "bar": {
               "catalog_name": "main",
        -      "lifecycle": {
        -        "depends_on": [
        -          {
        -            "resource": "schemas.my"
        -          }
        -        ]
        -      },
               "name": "volumebar-[UNIQUE_NAME]",
        -      "schema_name": "myschema-[UNIQUE_NAME]",
        +      "schema_name": "${resources.schemas.my.name}",
               "volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumebar-[UNIQUE_NAME]",
               "volume_type": "MANAGED"
             },
             "foo": {
               "catalog_name": "main",
               "comment": "/Volumes/main/myschema-[UNIQUE_NAME]/volumebar-[UNIQUE_NAME]",
        -      "lifecycle": {
        -        "depends_on": [
        -          {
        -            "resource": "schemas.my"
        -          }
        -        ]
        -      },
               "name": "volumefoo-[UNIQUE_NAME]",
        -      "schema_name": "myschema-[UNIQUE_NAME]",
        +      "schema_name": "${resources.schemas.my.name}",
               "volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumefoo-[UNIQUE_NAME]",
               "volume_type": "MANAGED"
             }

latest (v1.22.1):

acceptance_test.go:1341: Diff:
        --- bundle/resource_deps/computed_volume_path/output.txt
        +++ /tmp/TestAcceptbundleresource_depscomputed_volume_pathDMS=true750987299/002/output.txt
        @@ -10,30 +10,16 @@
           "volumes": {
             "bar": {
               "catalog_name": "main",
        -      "lifecycle": {
        -        "depends_on": [
        -          {
        -            "resource": "schemas.my"
        -          }
        -        ]
        -      },
               "name": "volumebar-[UNIQUE_NAME]",
        -      "schema_name": "myschema-[UNIQUE_NAME]",
        +      "schema_name": "${resources.schemas.my.name}",
               "volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumebar-[UNIQUE_NAME]",
               "volume_type": "MANAGED"
             },
             "foo": {
               "catalog_name": "main",
               "comment": "/Volumes/main/myschema-[UNIQUE_NAME]/volumebar-[UNIQUE_NAME]",
        -      "lifecycle": {
        -        "depends_on": [
        -          {
        -            "resource": "schemas.my"
        -          }
        -        ]
        -      },
               "name": "volumefoo-[UNIQUE_NAME]",
        -      "schema_name": "myschema-[UNIQUE_NAME]",
        +      "schema_name": "${resources.schemas.my.name}",
               "volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumefoo-[UNIQUE_NAME]",
               "volume_type": "MANAGED"
             }
        
FAIL
TestAccept/bundle/resource_deps/implicit_deps_model_serving_endpoint/DMS=: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/resource_deps/implicit_deps_model_serving_endpoint/output.txt
        +++ /tmp/TestAcceptbundleresource_depsimplicit_deps_model_serving_endp558585286/002/output.txt
        @@ -11,11 +11,11 @@
             "depends_on": [
               {
                 "node": "resources.catalogs.my_catalog",
        -        "label": "depends_on"
        +        "label": "${resources.catalogs.my_catalog.name}"
               },
               {
                 "node": "resources.schemas.my_schema",
        -        "label": "depends_on"
        +        "label": "${resources.schemas.my_schema.name}"
               }
             ],
             "new_state": {
        @@ -33,7 +30,7 @@
             "depends_on": [
               {
                 "node": "resources.catalogs.my_catalog",
        -        "label": "depends_on"
        +        "label": "${resources.catalogs.my_catalog.name}"
               }
             ],
             "new_state": {

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resource_deps/implicit_deps_model_serving_endpoint/DMS=true: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/resource_deps/implicit_deps_model_serving_endpoint/output.txt
        +++ /tmp/TestAcceptbundleresource_depsimplicit_deps_model_serving_endp1923301490/002/output.txt
        @@ -11,11 +11,11 @@
             "depends_on": [
               {
                 "node": "resources.catalogs.my_catalog",
        -        "label": "depends_on"
        +        "label": "${resources.catalogs.my_catalog.name}"
               },
               {
                 "node": "resources.schemas.my_schema",
        -        "label": "depends_on"
        +        "label": "${resources.schemas.my_schema.name}"
               }
             ],
             "new_state": {
        @@ -33,7 +30,7 @@
             "depends_on": [
               {
                 "node": "resources.catalogs.my_catalog",
        -        "label": "depends_on"
        +        "label": "${resources.catalogs.my_catalog.name}"
               }
             ],
             "new_state": {

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resource_deps/implicit_deps_quality_monitor/DMS=: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/resource_deps/implicit_deps_quality_monitor/output.txt
        +++ /tmp/TestAcceptbundleresource_depsimplicit_deps_quality_monitorDM309664521/002/output.txt
        @@ -15,11 +15,11 @@
             "depends_on": [
               {
                 "node": "resources.catalogs.my_catalog",
        -        "label": "depends_on"
        +        "label": "${resources.catalogs.my_catalog.name}"
               },
               {
                 "node": "resources.schemas.my_schema",
        -        "label": "depends_on"
        +        "label": "${resources.schemas.my_schema.name}"
               }
             ],
             "new_state": {
        @@ -32,7 +29,7 @@
             "depends_on": [
               {
                 "node": "resources.catalogs.my_catalog",
        -        "label": "depends_on"
        +        "label": "${resources.catalogs.my_catalog.name}"
               }
             ],
             "new_state": {

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resource_deps/implicit_deps_quality_monitor/DMS=true: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/resource_deps/implicit_deps_quality_monitor/output.txt
        +++ /tmp/TestAcceptbundleresource_depsimplicit_deps_quality_monitorDM2379592668/002/output.txt
        @@ -15,11 +15,11 @@
             "depends_on": [
               {
                 "node": "resources.catalogs.my_catalog",
        -        "label": "depends_on"
        +        "label": "${resources.catalogs.my_catalog.name}"
               },
               {
                 "node": "resources.schemas.my_schema",
        -        "label": "depends_on"
        +        "label": "${resources.schemas.my_schema.name}"
               }
             ],
             "new_state": {
        @@ -32,7 +29,7 @@
             "depends_on": [
               {
                 "node": "resources.catalogs.my_catalog",
        -        "label": "depends_on"
        +        "label": "${resources.catalogs.my_catalog.name}"
               }
             ],
             "new_state": {

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resource_deps/implicit_deps_registered_model/DMS=: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1341
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1082
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:659
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle plan -t dev -o json\n{\n  \"resources.catalogs.my_catalog\": {\n    \"depends_on\": null,\n    \"new_state\": {\n      \"name\": \"mycatalog\"\n    }\n  },\n  \"resources.registered_models.my_model\": {\n    \"depends_on\": [\n      {\n        \"node\": \"resources.catalogs.my_catalog\",\n        \"label\": \"depends_on\"\n      },\n      {\n        \"node\": \"resources.schemas.my_schema\",\n        \"label\": \"depends_on\"\n      }\n    ],\n    \"new_state\": {\n      \"catalog_name\": \"mycatalog\",\n      \"name\": \"dev_[USERNAME]_mymodel\",\n      \"schema_name\": \"dev_[USERNAME]_myschema\"\n    }\n  },\n  \"resources.schemas.my_schema\": {\n    \"depends_on\": [\n      {\n        \"node\": \"resources.catalogs.my_catalog\",\n        \"label\": \"depends_on\"\n      }\n    ],\n    \"new_state\": {\n      \"catalog_name\": \"mycatalog\",\n      \"name\": \"dev_[USERNAME]_myschema\"\n    }\n  }\n}\n"
        	            	actual  : "\n>>> [CLI] bundle plan -t dev -o json\n{\n  \"resources.catalogs.my_catalog\": {\n    \"depends_on\": null,\n    \"new_state\": {\n      \"name\": \"mycatalog\"\n    }\n  },\n  \"resources.registered_models.my_model\": {\n    \"depends_on\": [\n      {\n        \"node\": \"resources.catalogs.my_catalog\",\n        \"label\": \"${resources.catalogs.my_catalog.name}\"\n      },\n      {\n        \"node\": \"resources.schemas.my_schema\",\n        \"label\": \"${resources.schemas.my_schema.name}\"\n      }\n    ],\n    \"new_state\": {\n      \"catalog_name\": \"mycatalog\",\n      \"name\": \"dev_[USERNAME]_mymodel\",\n      \"schema_name\": \"dev_[USERNAME]_myschema\"\n    }\n  },\n  \"resources.schemas.my_schema\": {\n    \"depends_on\": [\n      {\n        \"node\": \"resources.catalogs.my_catalog\",\n        \"label\": \"${resources.catalogs.my_catalog.name}\"\n      }\n    ],\n    \"new_state\": {\n      \"catalog_name\": \"mycatalog\",\n      \"name\": \"dev_[USERNAME]_myschema\"\n    }\n  }\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -13,3 +13,3 @@
        	            	         "node": "resources.catalogs.my_catalog",
        	            	-        "label": "depends_on"
        	            	+        "label": "${resources.catalogs.my_catalog.name}"
        	            	       },
        	            	@@ -17,3 +17,3 @@
        	            	         "node": "resources.schemas.my_schema",
        	            	-        "label": "depends_on"
        	            	+        "label": "${resources.schemas.my_schema.name}"
        	            	       }
        	            	@@ -30,3 +30,3 @@
        	            	         "node": "resources.catalogs.my_catalog",
        	            	-        "label": "depends_on"
        	            	+        "label": "${resources.catalogs.my_catalog.name}"
        	            	       }
        	Test:       	TestAccept/bundle/resource_deps/implicit_deps_registered_model/DMS=
        	Messages:   	bundle/resource_deps/implicit_deps_registered_model/output.txt vs /tmp/TestAcceptbundleresource_depsimplicit_deps_registered_modelD1345554949/002/output.txt

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resource_deps/implicit_deps_registered_model/DMS=true: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1341
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1082
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:659
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle plan -t dev -o json\n{\n  \"resources.catalogs.my_catalog\": {\n    \"depends_on\": null,\n    \"new_state\": {\n      \"name\": \"mycatalog\"\n    }\n  },\n  \"resources.registered_models.my_model\": {\n    \"depends_on\": [\n      {\n        \"node\": \"resources.catalogs.my_catalog\",\n        \"label\": \"depends_on\"\n      },\n      {\n        \"node\": \"resources.schemas.my_schema\",\n        \"label\": \"depends_on\"\n      }\n    ],\n    \"new_state\": {\n      \"catalog_name\": \"mycatalog\",\n      \"name\": \"dev_[USERNAME]_mymodel\",\n      \"schema_name\": \"dev_[USERNAME]_myschema\"\n    }\n  },\n  \"resources.schemas.my_schema\": {\n    \"depends_on\": [\n      {\n        \"node\": \"resources.catalogs.my_catalog\",\n        \"label\": \"depends_on\"\n      }\n    ],\n    \"new_state\": {\n      \"catalog_name\": \"mycatalog\",\n      \"name\": \"dev_[USERNAME]_myschema\"\n    }\n  }\n}\n"
        	            	actual  : "\n>>> [CLI] bundle plan -t dev -o json\n{\n  \"resources.catalogs.my_catalog\": {\n    \"depends_on\": null,\n    \"new_state\": {\n      \"name\": \"mycatalog\"\n    }\n  },\n  \"resources.registered_models.my_model\": {\n    \"depends_on\": [\n      {\n        \"node\": \"resources.catalogs.my_catalog\",\n        \"label\": \"${resources.catalogs.my_catalog.name}\"\n      },\n      {\n        \"node\": \"resources.schemas.my_schema\",\n        \"label\": \"${resources.schemas.my_schema.name}\"\n      }\n    ],\n    \"new_state\": {\n      \"catalog_name\": \"mycatalog\",\n      \"name\": \"dev_[USERNAME]_mymodel\",\n      \"schema_name\": \"dev_[USERNAME]_myschema\"\n    }\n  },\n  \"resources.schemas.my_schema\": {\n    \"depends_on\": [\n      {\n        \"node\": \"resources.catalogs.my_catalog\",\n        \"label\": \"${resources.catalogs.my_catalog.name}\"\n      }\n    ],\n    \"new_state\": {\n      \"catalog_name\": \"mycatalog\",\n      \"name\": \"dev_[USERNAME]_myschema\"\n    }\n  }\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -13,3 +13,3 @@
        	            	         "node": "resources.catalogs.my_catalog",
        	            	-        "label": "depends_on"
        	            	+        "label": "${resources.catalogs.my_catalog.name}"
        	            	       },
        	            	@@ -17,3 +17,3 @@
        	            	         "node": "resources.schemas.my_schema",
        	            	-        "label": "depends_on"
        	            	+        "label": "${resources.schemas.my_schema.name}"
        	            	       }
        	            	@@ -30,3 +30,3 @@
        	            	         "node": "resources.catalogs.my_catalog",
        	            	-        "label": "depends_on"
        	            	+        "label": "${resources.catalogs.my_catalog.name}"
        	            	       }
        	Test:       	TestAccept/bundle/resource_deps/implicit_deps_registered_model/DMS=true
        	Messages:   	bundle/resource_deps/implicit_deps_registered_model/output.txt vs /tmp/TestAcceptbundleresource_depsimplicit_deps_registered_modelD2983666086/002/output.txt

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resource_deps/implicit_deps_vector_search_index/DMS=: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/resource_deps/implicit_deps_vector_search_index/output.txt
        +++ /tmp/TestAcceptbundleresource_depsimplicit_deps_vector_search_inde3294366386/002/output.txt
        @@ -11,7 +11,7 @@
             "depends_on": [
               {
                 "node": "resources.catalogs.my_catalog",
        -        "label": "depends_on"
        +        "label": "${resources.catalogs.my_catalog.name}"
               }
             ],
             "new_state": {
        @@ -61,11 +61,11 @@
             "depends_on": [
               {
                 "node": "resources.catalogs.my_catalog",
        -        "label": "depends_on"
        +        "label": "${resources.catalogs.my_catalog.name}"
               },
               {
                 "node": "resources.schemas.my_schema",
        -        "label": "depends_on"
        +        "label": "${resources.schemas.my_schema.name}"
               }
             ],
             "new_state": {

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resource_deps/implicit_deps_vector_search_index/DMS=true: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/resource_deps/implicit_deps_vector_search_index/output.txt
        +++ /tmp/TestAcceptbundleresource_depsimplicit_deps_vector_search_inde385160588/002/output.txt
        @@ -11,7 +11,7 @@
             "depends_on": [
               {
                 "node": "resources.catalogs.my_catalog",
        -        "label": "depends_on"
        +        "label": "${resources.catalogs.my_catalog.name}"
               }
             ],
             "new_state": {
        @@ -61,11 +61,11 @@
             "depends_on": [
               {
                 "node": "resources.catalogs.my_catalog",
        -        "label": "depends_on"
        +        "label": "${resources.catalogs.my_catalog.name}"
               },
               {
                 "node": "resources.schemas.my_schema",
        -        "label": "depends_on"
        +        "label": "${resources.schemas.my_schema.name}"
               }
             ],
             "new_state": {

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resource_deps/implicit_deps_volume/DMS=: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1341
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1082
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:659
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle plan -t dev -o json\n{\n  \"resources.catalogs.my_catalog\": {\n    \"depends_on\": null,\n    \"new_state\": {\n      \"name\": \"mycatalog\"\n    }\n  },\n  \"resources.schemas.my_schema\": {\n    \"depends_on\": [\n      {\n        \"node\": \"resources.catalogs.my_catalog\",\n        \"label\": \"depends_on\"\n      }\n    ],\n    \"new_state\": {\n      \"catalog_name\": \"mycatalog\",\n      \"name\": \"dev_[USERNAME]_myschema\"\n    }\n  },\n  \"resources.volumes.my_volume\": {\n    \"depends_on\": [\n      {\n        \"node\": \"resources.catalogs.my_catalog\",\n        \"label\": \"depends_on\"\n      },\n      {\n        \"node\": \"resources.schemas.my_schema\",\n        \"label\": \"depends_on\"\n      }\n    ],\n    \"new_state\": {\n      \"catalog_name\": \"mycatalog\",\n      \"name\": \"myvolume\",\n      \"schema_name\": \"dev_[USERNAME]_myschema\",\n      \"volume_type\": \"MANAGED\"\n    }\n  }\n}\n"
        	            	actual  : "\n>>> [CLI] bundle plan -t dev -o json\n{\n  \"resources.catalogs.my_catalog\": {\n    \"depends_on\": null,\n    \"new_state\": {\n      \"name\": \"mycatalog\"\n    }\n  },\n  \"resources.schemas.my_schema\": {\n    \"depends_on\": [\n      {\n        \"node\": \"resources.catalogs.my_catalog\",\n        \"label\": \"${resources.catalogs.my_catalog.name}\"\n      }\n    ],\n    \"new_state\": {\n      \"catalog_name\": \"mycatalog\",\n      \"name\": \"dev_[USERNAME]_myschema\"\n    }\n  },\n  \"resources.volumes.my_volume\": {\n    \"depends_on\": [\n      {\n        \"node\": \"resources.catalogs.my_catalog\",\n        \"label\": \"${resources.catalogs.my_catalog.name}\"\n      },\n      {\n        \"node\": \"resources.schemas.my_schema\",\n        \"label\": \"${resources.schemas.my_schema.name}\"\n      }\n    ],\n    \"new_state\": {\n      \"catalog_name\": \"mycatalog\",\n      \"name\": \"myvolume\",\n      \"schema_name\": \"dev_[USERNAME]_myschema\",\n      \"volume_type\": \"MANAGED\"\n    }\n  }\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -13,3 +13,3 @@
        	            	         "node": "resources.catalogs.my_catalog",
        	            	-        "label": "depends_on"
        	            	+        "label": "${resources.catalogs.my_catalog.name}"
        	            	       }
        	            	@@ -25,3 +25,3 @@
        	            	         "node": "resources.catalogs.my_catalog",
        	            	-        "label": "depends_on"
        	            	+        "label": "${resources.catalogs.my_catalog.name}"
        	            	       },
        	            	@@ -29,3 +29,3 @@
        	            	         "node": "resources.schemas.my_schema",
        	            	-        "label": "depends_on"
        	            	+        "label": "${resources.schemas.my_schema.name}"
        	            	       }
        	Test:       	TestAccept/bundle/resource_deps/implicit_deps_volume/DMS=
        	Messages:   	bundle/resource_deps/implicit_deps_volume/output.txt vs /tmp/TestAcceptbundleresource_depsimplicit_deps_volumeDMS=2405661520/002/output.txt

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resource_deps/implicit_deps_volume/DMS=true: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1341
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1082
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:659
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle plan -t dev -o json\n{\n  \"resources.catalogs.my_catalog\": {\n    \"depends_on\": null,\n    \"new_state\": {\n      \"name\": \"mycatalog\"\n    }\n  },\n  \"resources.schemas.my_schema\": {\n    \"depends_on\": [\n      {\n        \"node\": \"resources.catalogs.my_catalog\",\n        \"label\": \"depends_on\"\n      }\n    ],\n    \"new_state\": {\n      \"catalog_name\": \"mycatalog\",\n      \"name\": \"dev_[USERNAME]_myschema\"\n    }\n  },\n  \"resources.volumes.my_volume\": {\n    \"depends_on\": [\n      {\n        \"node\": \"resources.catalogs.my_catalog\",\n        \"label\": \"depends_on\"\n      },\n      {\n        \"node\": \"resources.schemas.my_schema\",\n        \"label\": \"depends_on\"\n      }\n    ],\n    \"new_state\": {\n      \"catalog_name\": \"mycatalog\",\n      \"name\": \"myvolume\",\n      \"schema_name\": \"dev_[USERNAME]_myschema\",\n      \"volume_type\": \"MANAGED\"\n    }\n  }\n}\n"
        	            	actual  : "\n>>> [CLI] bundle plan -t dev -o json\n{\n  \"resources.catalogs.my_catalog\": {\n    \"depends_on\": null,\n    \"new_state\": {\n      \"name\": \"mycatalog\"\n    }\n  },\n  \"resources.schemas.my_schema\": {\n    \"depends_on\": [\n      {\n        \"node\": \"resources.catalogs.my_catalog\",\n        \"label\": \"${resources.catalogs.my_catalog.name}\"\n      }\n    ],\n    \"new_state\": {\n      \"catalog_name\": \"mycatalog\",\n      \"name\": \"dev_[USERNAME]_myschema\"\n    }\n  },\n  \"resources.volumes.my_volume\": {\n    \"depends_on\": [\n      {\n        \"node\": \"resources.catalogs.my_catalog\",\n        \"label\": \"${resources.catalogs.my_catalog.name}\"\n      },\n      {\n        \"node\": \"resources.schemas.my_schema\",\n        \"label\": \"${resources.schemas.my_schema.name}\"\n      }\n    ],\n    \"new_state\": {\n      \"catalog_name\": \"mycatalog\",\n      \"name\": \"myvolume\",\n      \"schema_name\": \"dev_[USERNAME]_myschema\",\n      \"volume_type\": \"MANAGED\"\n    }\n  }\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -13,3 +13,3 @@
        	            	         "node": "resources.catalogs.my_catalog",
        	            	-        "label": "depends_on"
        	            	+        "label": "${resources.catalogs.my_catalog.name}"
        	            	       }
        	            	@@ -25,3 +25,3 @@
        	            	         "node": "resources.catalogs.my_catalog",
        	            	-        "label": "depends_on"
        	            	+        "label": "${resources.catalogs.my_catalog.name}"
        	            	       },
        	            	@@ -29,3 +29,3 @@
        	            	         "node": "resources.schemas.my_schema",
        	            	-        "label": "depends_on"
        	            	+        "label": "${resources.schemas.my_schema.name}"
        	            	       }
        	Test:       	TestAccept/bundle/resource_deps/implicit_deps_volume/DMS=true
        	Messages:   	bundle/resource_deps/implicit_deps_volume/output.txt vs /tmp/TestAcceptbundleresource_depsimplicit_deps_volumeDMS=true4278895163/002/output.txt

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resource_deps/remote_field_storage_location/DMS=: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/resource_deps/remote_field_storage_location/output.txt
        +++ /tmp/TestAcceptbundleresource_depsremote_field_storage_locationDM2491217974/002/output.txt
        @@ -10,30 +10,16 @@
           "volumes": {
             "bar": {
               "catalog_name": "main",
        -      "lifecycle": {
        -        "depends_on": [
        -          {
        -            "resource": "schemas.my"
        -          }
        -        ]
        -      },
               "name": "volumebar-[UNIQUE_NAME]",
        -      "schema_name": "myschema-[UNIQUE_NAME]",
        +      "schema_name": "${resources.schemas.my.name}",
               "volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumebar-[UNIQUE_NAME]",
               "volume_type": "MANAGED"
             },
             "foo": {
               "catalog_name": "main",
               "comment": "${resources.volumes.bar.storage_location}",
        -      "lifecycle": {
        -        "depends_on": [
        -          {
        -            "resource": "schemas.my"
        -          }
        -        ]
        -      },
               "name": "volumefoo-[UNIQUE_NAME]",
        -      "schema_name": "myschema-[UNIQUE_NAME]",
        +      "schema_name": "${resources.schemas.my.name}",
               "volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumefoo-[UNIQUE_NAME]",
               "volume_type": "MANAGED"
             }

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resource_deps/remote_field_storage_location/DMS=true: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/resource_deps/remote_field_storage_location/output.txt
        +++ /tmp/TestAcceptbundleresource_depsremote_field_storage_locationDM848964972/002/output.txt
        @@ -10,30 +10,16 @@
           "volumes": {
             "bar": {
               "catalog_name": "main",
        -      "lifecycle": {
        -        "depends_on": [
        -          {
        -            "resource": "schemas.my"
        -          }
        -        ]
        -      },
               "name": "volumebar-[UNIQUE_NAME]",
        -      "schema_name": "myschema-[UNIQUE_NAME]",
        +      "schema_name": "${resources.schemas.my.name}",
               "volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumebar-[UNIQUE_NAME]",
               "volume_type": "MANAGED"
             },
             "foo": {
               "catalog_name": "main",
               "comment": "${resources.volumes.bar.storage_location}",
        -      "lifecycle": {
        -        "depends_on": [
        -          {
        -            "resource": "schemas.my"
        -          }
        -        ]
        -      },
               "name": "volumefoo-[UNIQUE_NAME]",
        -      "schema_name": "myschema-[UNIQUE_NAME]",
        +      "schema_name": "${resources.schemas.my.name}",
               "volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumefoo-[UNIQUE_NAME]",
               "volume_type": "MANAGED"
             }
        
FAIL

latest (v1.22.1):

acceptance_test.go:1341: Diff:
        --- bundle/resource_deps/remote_field_storage_location/output.txt
        +++ /tmp/TestAcceptbundleresource_depsremote_field_storage_locationDM836032269/002/output.txt
        @@ -10,30 +10,16 @@
           "volumes": {
             "bar": {
               "catalog_name": "main",
        -      "lifecycle": {
        -        "depends_on": [
        -          {
        -            "resource": "schemas.my"
        -          }
        -        ]
        -      },
               "name": "volumebar-[UNIQUE_NAME]",
        -      "schema_name": "myschema-[UNIQUE_NAME]",
        +      "schema_name": "${resources.schemas.my.name}",
               "volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumebar-[UNIQUE_NAME]",
               "volume_type": "MANAGED"
             },
             "foo": {
               "catalog_name": "main",
               "comment": "${resources.volumes.bar.storage_location}",
        -      "lifecycle": {
        -        "depends_on": [
        -          {
        -            "resource": "schemas.my"
        -          }
        -        ]
        -      },
               "name": "volumefoo-[UNIQUE_NAME]",
        -      "schema_name": "myschema-[UNIQUE_NAME]",
        +      "schema_name": "${resources.schemas.my.name}",
               "volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumefoo-[UNIQUE_NAME]",
               "volume_type": "MANAGED"
             }
TestAccept/bundle/resources/grants/registered_models/DMS=: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/resources/grants/registered_models/out.plan1.json
        +++ /tmp/TestAcceptbundleresourcesgrantsregistered_modelsDMS=2064457588/001/out.plan1.json
        @@ -6,7 +6,7 @@
               "depends_on": [
                 {
                   "node": "resources.schemas.my_schema",
        -          "label": "depends_on"
        +          "label": "${resources.schemas.my_schema.name}"
                 }
               ],
               "action": "create",

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resources/grants/registered_models/DMS=true: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/resources/grants/registered_models/out.plan1.json
        +++ /tmp/TestAcceptbundleresourcesgrantsregistered_modelsDMS=true2238962209/001/out.plan1.json
        @@ -6,7 +6,7 @@
               "depends_on": [
                 {
                   "node": "resources.schemas.my_schema",
        -          "label": "depends_on"
        +          "label": "${resources.schemas.my_schema.name}"
                 }
               ],
               "action": "create",

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resources/grants/volumes/DMS=: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/resources/grants/volumes/out.plan1.json
        +++ /tmp/TestAcceptbundleresourcesgrantsvolumesDMS=2561754761/001/out.plan1.json
        @@ -15,7 +15,7 @@
               "depends_on": [
                 {
                   "node": "resources.schemas.grants_schema",
        -          "label": "depends_on"
        +          "label": "${resources.schemas.grants_schema.name}"
                 }
               ],
               "action": "create",
        
    acceptance_test.go:1341: Diff:
        --- bundle/resources/grants/volumes/out.plan2.json
        +++ /tmp/TestAcceptbundleresourcesgrantsvolumesDMS=2561754761/001/out.plan2.json
        @@ -21,7 +21,7 @@
               "depends_on": [
                 {
                   "node": "resources.schemas.grants_schema",
        -          "label": "depends_on"
        +          "label": "${resources.schemas.grants_schema.name}"
                 }
               ],
               "action": "skip",

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resources/grants/volumes/DMS=true: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/resources/grants/volumes/out.plan1.json
        +++ /tmp/TestAcceptbundleresourcesgrantsvolumesDMS=true2616471239/001/out.plan1.json
        @@ -15,7 +15,7 @@
               "depends_on": [
                 {
                   "node": "resources.schemas.grants_schema",
        -          "label": "depends_on"
        +          "label": "${resources.schemas.grants_schema.name}"
                 }
               ],
               "action": "create",
        
    acceptance_test.go:1341: Diff:
        --- bundle/resources/grants/volumes/out.plan2.json
        +++ /tmp/TestAcceptbundleresourcesgrantsvolumesDMS=true2616471239/001/out.plan2.json
        @@ -21,7 +21,7 @@
               "depends_on": [
                 {
                   "node": "resources.schemas.grants_schema",
        -          "label": "depends_on"
        +          "label": "${resources.schemas.grants_schema.name}"
                 }
               ],
               "action": "skip",

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resources/volumes/catalog-var-ref/DMS=: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/resources/volumes/catalog-var-ref/output.txt
        +++ /tmp/TestAcceptbundleresourcesvolumescatalog-var-refDMS=2033953084/002/output.txt
        @@ -16,7 +16,7 @@
               "depends_on": [
                 {
                   "node": "resources.catalogs.main_catalog",
        -          "label": "depends_on"
        +          "label": "${resources.catalogs.main_catalog.name}"
                 }
               ],
               "action": "create",
        @@ -31,11 +31,11 @@
               "depends_on": [
                 {
                   "node": "resources.catalogs.main_catalog",
        -          "label": "depends_on"
        +          "label": "${resources.catalogs.main_catalog.name}"
                 },
                 {
                   "node": "resources.schemas.raw_schema",
        -          "label": "depends_on"
        +          "label": "${resources.schemas.raw_schema.name}"
                 }
               ],
               "action": "create",

latest (v1.22.1): same output as main (35ed095)

TestAccept/bundle/resources/volumes/catalog-var-ref/DMS=true: branch ✅ | main (35ed095) ❌ | latest (v1.22.1) ❌

main (35ed095):

acceptance_test.go:1341: Diff:
        --- bundle/resources/volumes/catalog-var-ref/output.txt
        +++ /tmp/TestAcceptbundleresourcesvolumescatalog-var-refDMS=true4240972648/002/output.txt
        @@ -16,7 +16,7 @@
               "depends_on": [
                 {
                   "node": "resources.catalogs.main_catalog",
        -          "label": "depends_on"
        +          "label": "${resources.catalogs.main_catalog.name}"
                 }
               ],
               "action": "create",
        @@ -31,11 +31,11 @@
               "depends_on": [
                 {
                   "node": "resources.catalogs.main_catalog",
        -          "label": "depends_on"
        +          "label": "${resources.catalogs.main_catalog.name}"
                 },
                 {
                   "node": "resources.schemas.raw_schema",
        -          "label": "depends_on"
        +          "label": "${resources.schemas.raw_schema.name}"
                 }
               ],
               "action": "create",

latest (v1.22.1): same output as main (35ed095)

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 1965104

Run: 40708616402

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 290 23 6:37
✅​ aws-windows-latest-4core-16gb 292 21 5:03
✅​ azure linux-2core-8gb 286 24 6:35
✅​ azure-windows-latest-4core-16gb 288 22 3:55
✅​ gcp linux-2core-8gb 287 24 6:23
✅​ gcp-windows-latest-4core-16gb 289 22 4:52
Top 6 slowest tests (at least 2 minutes):
duration env testname
4:22 aws-windows-latest-4core-16gb TestAccept
4:21 gcp-windows-latest-4core-16gb TestAccept
3:52 azure linux-2core-8gb TestAccept
3:51 gcp linux-2core-8gb TestAccept
3:49 aws linux-2core-8gb TestAccept
3:22 azure-windows-latest-4core-16gb TestAccept

@denik
denik force-pushed the capture-uc-depends-on branch 2 times, most recently from 9b84e22 to 7092af3 Compare October 26, 2026 10:11
@denik
denik force-pushed the capture-uc-depends-on branch from 7092af3 to a0662b8 Compare October 26, 2026 11:01
Base automatically changed from denik/depends-on to main October 26, 2026 11:11
denik added a commit that referenced this pull request Oct 26, 2026
## Changes
Add `lifecycle.depends_on`, a list of `- resource: <key>` entries (`foo`
or `jobs.foo`) that orders a resource after the listed ones on deploy
and before them on destroy. Edges are saved in state like
reference-derived ones, including by `bundle migrate`. A target that is
skipped from the plan is ignored.

Uses `Resources.ResolveKey` from
#7128. Used by
#7132 to replace the references
injected for implicit schema/catalog dependencies.

## Tests
Acceptance tests for ordering, validation errors, and a config with
`depends_on` migrating from Terraform.

This pull request and its description were written by Isaac.

---------

Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik force-pushed the capture-uc-depends-on branch from a0662b8 to 0f50eed Compare October 27, 2026 11:22
denik and others added 3 commits October 28, 2026 15:31
Dependents keep the literal schema name, and ApplyPresets prefixes it
together with the schema instead of relying on an injected reference.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
The plan shows the edges and the state that is sent, including the
development-mode prefix on schema names, unlike validate output.

Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik force-pushed the capture-uc-depends-on branch from 0f50eed to 1965104 Compare October 28, 2026 14:41
idelafuente-oc pushed a commit to idelafuente-oc/cli that referenced this pull request Nov 11, 2026
## Changes
One resolver for a resource given as `key` or `type.key`, replacing
three copies: `ResolveSelect`, and `FindResourceByConfigKey` used by
`bundle deployment bind`/`unbind` and `apps import`. `bind` and `unbind`
now also accept `type.key`.

## Why
Preparation for `lifecycle.depends_on`, which needs the same resolution:
databricks#7120 (and
databricks#7132 on top of it).

This pull request and its description were written by Isaac.

---------

Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions

Copy link
Copy Markdown
Contributor

This PR has not received an update in a while. If you want to keep this PR open, please leave a comment below or push a new commit and auto-close will be canceled.

@github-actions github-actions Bot added the Stale label Nov 11, 2026

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 Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants