Skip to content

Expose computed volume_path during initialize#5550

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

Expose computed volume_path during initialize#5550
radakam wants to merge 14 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 embedded 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...} references, it resolves them only to build the path — your original references stay untouched in config. References that can't be resolved yet (e.g. a remote field like another resource's id/creator_user_name) are embedded into volume_path and resolve at deploy.
  • 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. The exclusion happens in extractReferences, which validates each reference's field path against the resource's state type and drops fields (like volume_path) that exist in input config but not in state.

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). The volume's schema_name/name themselves reference another job's remote creator_user_name, so volume_path is computed at initialize with the reference embedded and the whole chain (foodata.volume_pathprocess) resolves at deploy. Records per-engine plan and deploy requests to confirm interpolation.
    • volume_path_contains_id — a volume's name is a remote value (another volume's id), so its volume_path carries that reference, and a third volume's comment picks up the embedded string 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.
  • Invariant (no_drift) — added a volume_path_job_ref config that deploys the embedded-reference chain and asserts no drift on re-plan.

@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: b3d6786

Run: 28165660870

Env 🟨​KNOWN 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 1 13 243 1027 5:43
🟨​ aws windows 7 1 13 245 1025 9:44
💚​ aws-ucws linux 8 13 330 944 5:03
💚​ aws-ucws windows 8 13 332 942 6:03
💚​ azure linux 2 15 246 1025 4:47
💚​ azure windows 2 15 248 1023 6:10
💚​ azure-ucws linux 2 15 335 940 5:10
💚​ azure-ucws windows 2 15 337 938 6:08
💚​ gcp linux 2 15 245 1027 4:19
💚​ gcp windows 2 15 247 1025 6:05
21 interesting tests: 13 SKIP, 7 KNOWN, 1 RECOVERED
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_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/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 4 slowest tests (at least 2 minutes):
duration env testname
4:11 gcp windows TestAccept
3:18 aws-ucws windows TestAccept
3:15 azure windows TestAccept
3:13 azure-ucws windows TestAccept

@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

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

/bundle/ - needs approval

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

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.

@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
# Conflicts:
#	NEXT_CHANGELOG.md
#	bundle/terraform_dabs_map/generated.go
@radakam radakam temporarily deployed to test-trigger-is June 22, 2026 12:41 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 22, 2026 12:41 — with GitHub Actions Inactive
Comment thread acceptance/bundle/resource_deps/volume_path_contains_id/script
Comment thread bundle/direct/bundle_plan.go Outdated
radakam added 3 commits June 25, 2026 08:09
Pass the resource's state type into extractReferences and drop references to
fields absent from state (e.g. volumes' computed volume_path) during the walk,
instead of post-filtering the combined refs map. Validating the structpath we
already build also avoids a string round-trip via structpath.ParsePath.

Also rename the acceptance test unresolved_volume_path -> volume_path_contains_id
and fix its script to invoke "$CLI bundle plan -o json".
Extend volume_path_job_ref so the volume's schema_name/name reference another
job's remote creator_user_name, so volume_path embeds an unresolved reference at
initialize that resolves at deploy. Add the same scenario as a no_drift
invariant config.
# Conflicts:
#	NEXT_CHANGELOG.md
#	bundle/direct/bundle_plan.go
@radakam radakam temporarily deployed to test-trigger-is June 25, 2026 08:52 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 25, 2026 08:52 — with GitHub Actions Inactive
Rewrite the state-type filter in extractReferences as a positive check to
satisfy the nilerr linter. Exclude the volume_path_job_ref invariant config
from the migrate and continue_293 suites: volume_path is unsupported by the
v0.293.0 seed CLI, and its embedded creator_user_name reference is not a
terraform-exported attribute. It remains covered by no_drift on direct.
@radakam radakam temporarily deployed to test-trigger-is June 25, 2026 11:04 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 25, 2026 11:04 — with GitHub Actions Inactive
…nt semantics

InitializeVolumePaths now rejects a user-provided volume_path instead of
silently overwriting the computed value, and ResolveVolumePathReferencesOnlyResources
errors when a referenced volume_path could not be computed rather than injecting
an empty string. Add a set-volume-path acceptance test for the rejection and
expand the changelog to document the deploy-ordering and Terraform-engine
caveats.
@radakam radakam deployed to test-trigger-is June 25, 2026 12:09 — with GitHub Actions Active
@radakam radakam temporarily deployed to test-trigger-is June 25, 2026 12:09 — 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