Skip to content

Expose computed volume_path during initialize#5550

Open
radakam wants to merge 8 commits into
mainfrom
volume-path-support
Open

Expose computed volume_path during initialize#5550
radakam wants to merge 8 commits into
mainfrom
volume-path-support

Conversation

@radakam

@radakam radakam commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Changes

Today, if you want to point one resource at a bundle-managed volume, you have to hand-write its full UC path:

/Volumes/main/my_schema/my_volume   # easy to get wrong, breaks on rename

This PR adds a computed, read-only volume_path on every volume so you can just reference it:

${resources.volumes.my_volume.volume_path}

volume_path is /Volumes/{catalog}/{schema}/{name} and shows up in validate and plan, so what you see is what gets deployed.

How it works:

  • Volume.VolumePath + ComputeVolumePath() build the path from catalog_name, schema_name, and name. If a part is still an unresolved ${...} reference, it's kept as-is and resolved later at plan/deploy; a malformed reference produces no path rather than leaking garbage.
  • InitializeVolumePaths computes the path during initialize. When catalog_name/schema_name point at ${resources.schemas...name}, it resolves them only to build the path — your original references stay untouched in config.
  • ResolveVolumePathReferencesOnlyResources then resolves references to volume_path and nothing else.
  • Both run after PythonMutator, since volume_path is computed/read-only and isn't part of the PyDABs model (same treatment as deployment metadata).
  • Since the field is CLI-only, it's dropped before Terraform conversion, marked alwaysSkip in config sync, and excluded as a direct-engine dependency (it lives in input config but not in resource state).

Closes DECO-26236, fixes #4233.

Why

Hardcoded volume paths are duplicated across a config and silently break when a catalog, schema, or volume name changes. A symbolic volume_path keeps the reference tied to the definition. This takes the schema + initialize-mutator approach so the path is visible at validate/plan time.

Tests

  • UnitComputeVolumePath (resolved / embedded reference / malformed), InitializeVolumePaths, volume-path-only resolution, and the Terraform drop.
  • Acceptance
    • computed_volume_path — a volume's comment references another volume's volume_path and resolves, while the original schema_name reference is left intact.
    • volume_path_job_ref — a job parameter references a volume's volume_path (the motivating use case from volumes: volume_path field is not available #4233).
    • unresolved_volume_path — an unresolved component stays embedded in volume_path and resolves at deploy.
    • Regenerated outputs across existing volume tests (change-comment, change-name, change-schema-name, bad_syntax, non_existent_field, …) now showing the new field.

@radakam radakam temporarily deployed to test-trigger-is June 11, 2026 12:16 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 11, 2026 12:16 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 11, 2026 12:32 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 11, 2026 12:32 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 11, 2026 12:54 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 11, 2026 12:54 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 11, 2026 13:00 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 11, 2026 13:00 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: d44f9f5

Run: 27748478046

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 14 264 1013 6:56
🟨​ aws windows 7 14 266 1011 11:16
💚​ aws-ucws linux 7 14 360 927 6:21
💚​ aws-ucws windows 7 14 362 925 9:13
💚​ azure linux 1 16 267 1011 5:35
💚​ azure windows 1 16 269 1009 8:26
💚​ azure-ucws linux 1 16 365 923 7:20
💚​ azure-ucws windows 1 16 367 921 10:26
🔄​ gcp linux 2 1 16 261 1014 7:11
💚​ gcp windows 1 16 265 1012 9:33
23 interesting tests: 14 SKIP, 7 KNOWN, 2 flaky
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🙈​ TestAccept/bundle/resources/postgres_branches/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/replace_existing 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/update_protected 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/without_branch_id 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_projects/update_display_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestAccept/selftest/record_cloud/pipeline-crud/DATABRICKS_BUNDLE_ENGINE=direct ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
🔄​ TestAccept/selftest/record_cloud/pipeline-crud/DATABRICKS_BUNDLE_ENGINE=terraform ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
Top 24 slowest tests (at least 2 minutes):
duration env testname
4:28 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:15 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:10 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:03 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:59 azure-ucws windows TestAccept
3:25 gcp windows TestAccept
3:21 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:17 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:14 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:13 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:12 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:12 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:10 azure windows TestAccept
3:05 aws-ucws windows TestAccept
3:04 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:58 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:48 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:45 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:44 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:43 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:39 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:35 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:31 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:29 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct

@radakam radakam force-pushed the volume-path-support branch from 6211576 to 0399701 Compare June 11, 2026 14:34
@radakam radakam temporarily deployed to test-trigger-is June 11, 2026 14:35 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 11, 2026 14:35 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 11, 2026 20:00 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 11, 2026 20:00 — with GitHub Actions Inactive
@radakam radakam changed the title [Bundle] Expose computed volume_path during initialize Expose computed volume_path during initialize Jun 11, 2026
@radakam radakam force-pushed the volume-path-support branch from 3aa9504 to b30a845 Compare June 12, 2026 08:44
@radakam radakam temporarily deployed to test-trigger-is June 12, 2026 08:45 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 12, 2026 08:45 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 12, 2026 08:53 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 12, 2026 08:53 — with GitHub Actions Inactive
@radakam radakam force-pushed the volume-path-support branch from 2827a4e to a240d86 Compare June 12, 2026 11:05
@radakam radakam temporarily deployed to test-trigger-is June 12, 2026 11:06 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 12, 2026 11:06 — with GitHub Actions Inactive
@radakam radakam force-pushed the volume-path-support branch from a240d86 to 3334a23 Compare June 12, 2026 11:52
@radakam radakam temporarily deployed to test-trigger-is June 12, 2026 11:52 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 12, 2026 11:52 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 12, 2026 12:06 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 12, 2026 12:06 — with GitHub Actions Inactive
@radakam radakam marked this pull request as ready for review June 13, 2026 09:21
@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

43 files changed
Suggested: @denik
Also eligible: @pietern, @janniklasrose, @shreyas-goenka, @andrewnester, @lennartkats-db, @anton-107

/bundle/ - needs approval

12 files changed
Suggested: @denik
Also eligible: @pietern, @janniklasrose, @shreyas-goenka, @andrewnester, @lennartkats-db, @anton-107

General files (require maintainer)

Files: NEXT_CHANGELOG.md
Based on git history:

  • @denik -- recent work in bundle/direct/, bundle/config/mutator/, ./

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db) can approve all areas.
See OWNERS for ownership rules.

Comment thread acceptance/bundle/resource_deps/volume_path_job_ref/script Outdated
Comment thread acceptance/bundle/resource_deps/remote_field_storage_location/script Outdated
Comment thread acceptance/bundle/resource_deps/unresolved_volume_path/databricks.yml Outdated
Comment thread bundle/config/mutator/initialize_volume_paths.go
@radakam radakam force-pushed the volume-path-support branch from b873061 to 45f3710 Compare June 15, 2026 09:22
@radakam radakam temporarily deployed to test-trigger-is June 15, 2026 09:23 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 15, 2026 09:23 — with GitHub Actions Inactive
@radakam radakam force-pushed the volume-path-support branch from 82dfe46 to 8918aa0 Compare June 17, 2026 19:07
@radakam radakam temporarily deployed to test-trigger-is June 17, 2026 19:08 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 17, 2026 19:08 — with GitHub Actions Inactive
radakam added 8 commits June 18, 2026 08:51
Add a computed, read-only volume_path field to volume resources, set to
the Unity Catalog path /Volumes/{catalog}/{schema}/{name} during the
initialize phase. This enables other resources to reference
${resources.volumes.<key>.volume_path}.

- InitializeVolumePaths resolves catalog_name/schema_name/name references
  locally to compute the path without mutating the original references, so
  validate and plan keep showing the references.
- volume_path is only set when catalog, schema, and name resolve to
  concrete values; unresolved or malformed references leave it empty.
- Computation runs after PythonMutator: volume_path is a computed field the
  PyDABs Volume model does not declare, so it must not be exposed to Python.
Cover behaviors the initial volume_path change did not exercise:

- unresolved_volume_path: a volume whose name is only known at deploy
  cannot have volume_path computed at plan time, so a reference to it
  resolves to an empty string (no error). Documented as known badness.
- volume_path_job_ref: the motivating use case from #4233, a job
  parameter referencing ${resources.volumes.<key>.volume_path}.
- Unit test for resolving a reference to an unset volume_path on an
  existing volume (resolves to empty rather than erroring).
Extend the volume_path_job_ref test to confirm ${resources.volumes.data.volume_path}
is interpolated end-to-end: record the JSON plan per engine and capture the
jobs/create request from a real deploy. Enable RecordRequests so the requests
can be inspected.
A volume component (catalog_name, schema_name, name) that cannot be
resolved locally is now embedded verbatim into volume_path as a ${...}
reference instead of suppressing the path. The embedded reference is
carried through ${resources.volumes.<key>.volume_path} interpolation and
resolved later by the engine during plan or deploy, like any other
resource reference.

Because volume_path is a readonly field that is dropped from state before
deploy, makePlan no longer treats a reference carried by such a field as a
dependency (the reference is still made available to readers during
initialize).
Rewrite unresolved_volume_path so an embedded ${...} reference in
volume_path is resolved at deploy rather than treated as an error: bar.name
comes from baz.id and foo.comment reads bar.volume_path, and the recorded
deploy requests confirm the path is fully interpolated. Update
non_existent_field output for the embedded-reference volume_path.
… trim comment

Rename the volume_path acceptance fixture to better reflect what it
covers, and shorten the explanatory comment in unresolved_volume_path.
The deploy order is deterministic via the dependency chain
(schema -> bar -> foo, since foo.comment references bar.storage_location),
so sorting only hid the ordering signal the test exists to verify.
@radakam radakam force-pushed the volume-path-support branch from 8918aa0 to d44f9f5 Compare June 18, 2026 08:58
@radakam radakam temporarily deployed to test-trigger-is June 18, 2026 08:58 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 18, 2026 08:58 — with GitHub Actions Inactive
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.

volumes: volume_path field is not available

3 participants