-
Notifications
You must be signed in to change notification settings - Fork 184
Expose computed volume_path during initialize #5550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
radakam
wants to merge
8
commits into
main
Choose a base branch
from
volume-path-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f31555c
bundle: expose computed volume_path during initialize
radakam 16e2e5e
acc: add volume_path edge-case and cross-resource tests
radakam 4883fe4
acc: add NEXT_CHANGELOG entry for volume_path
radakam fc1dce6
acc: record per-engine plan and deploy requests for volume_path job ref
radakam 5dd57ce
bundle: embed unresolved references into computed volume_path
radakam 6d09441
acc: show volume_path reference resolving at deploy
radakam 84be784
acc: rename remote_field_volume_path test to computed_volume_path and…
radakam d44f9f5
acc: drop --sort from remote_field_storage_location deploy requests
radakam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
acceptance/bundle/resource_deps/computed_volume_path/databricks.yml.tmpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| bundle: | ||
| name: testbundle-${UNIQUE_NAME} | ||
|
|
||
| resources: | ||
| schemas: | ||
| my: | ||
| catalog_name: main | ||
| name: myschema-${UNIQUE_NAME} | ||
|
|
||
| volumes: | ||
| bar: | ||
| catalog_name: main | ||
| schema_name: myschema-${UNIQUE_NAME} | ||
| name: volumebar-${UNIQUE_NAME} | ||
|
|
||
| foo: | ||
| catalog_name: main | ||
| schema_name: myschema-${UNIQUE_NAME} | ||
| name: volumefoo-${UNIQUE_NAME} | ||
| comment: ${resources.volumes.bar.volume_path} | ||
3 changes: 3 additions & 0 deletions
3
acceptance/bundle/resource_deps/computed_volume_path/out.test.toml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
acceptance/bundle/resource_deps/computed_volume_path/output.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
|
|
||
| >>> [CLI] bundle validate -o json | ||
| { | ||
| "schemas": { | ||
| "my": { | ||
| "catalog_name": "main", | ||
| "name": "myschema-[UNIQUE_NAME]" | ||
| } | ||
| }, | ||
| "volumes": { | ||
| "bar": { | ||
| "catalog_name": "main", | ||
| "name": "volumebar-[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]", | ||
| "name": "volumefoo-[UNIQUE_NAME]", | ||
| "schema_name": "${resources.schemas.my.name}", | ||
| "volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumefoo-[UNIQUE_NAME]", | ||
| "volume_type": "MANAGED" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| >>> [CLI] bundle plan | ||
| create schemas.my | ||
| create volumes.bar | ||
| create volumes.foo | ||
|
|
||
| Plan: 3 to add, 0 to change, 0 to delete, 0 unchanged | ||
|
|
||
| >>> print_requests.py --get //unity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| envsubst < databricks.yml.tmpl > databricks.yml | ||
| trace $CLI bundle validate -o json | jq .resources | ||
| trace $CLI bundle plan | ||
| trace print_requests.py --get //unity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
acceptance/bundle/resource_deps/unresolved_volume_path/databricks.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| bundle: | ||
| name: test-bundle | ||
|
|
||
| # volume_path is a CLI-only computed field (not API state). When a component | ||
| # (catalog_name, schema_name, name) is an unresolved ${...} reference, it stays | ||
| # embedded in volume_path so it resolves later at plan/deploy. | ||
| # | ||
| # Chain under test: bar.name is a remote value (baz.id), so bar.volume_path is | ||
| # computed at initialize with that reference intact; foo.comment picks up that | ||
| # string and resolves at deploy to the fully-resolved path. | ||
| # | ||
| # baz.id is used instead of baz.storage_location because the resolved value | ||
| # becomes bar's name, and the testserver can't route a name containing the | ||
| # slashes of a storage_location URL. | ||
| resources: | ||
| volumes: | ||
| baz: | ||
| catalog_name: mycatalog | ||
| schema_name: myschema | ||
| name: bazname | ||
| bar: | ||
| catalog_name: mycatalog | ||
| schema_name: myschema | ||
| name: ${resources.volumes.baz.id} | ||
| foo: | ||
| catalog_name: mycatalog | ||
| schema_name: myschema | ||
| name: fooname | ||
| comment: ${resources.volumes.bar.volume_path} |
6 changes: 6 additions & 0 deletions
6
acceptance/bundle/resource_deps/unresolved_volume_path/out.deploy.direct.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
|
|
||
| >>> errcode [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! |
31 changes: 31 additions & 0 deletions
31
acceptance/bundle/resource_deps/unresolved_volume_path/out.deploy.requests.direct.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "method": "POST", | ||
| "path": "/api/2.1/unity-catalog/volumes", | ||
| "body": { | ||
| "catalog_name": "mycatalog", | ||
| "comment": "/Volumes/mycatalog/myschema/mycatalog.myschema.bazname", | ||
| "name": "fooname", | ||
| "schema_name": "myschema", | ||
| "volume_type": "MANAGED" | ||
| } | ||
| } | ||
| { | ||
| "method": "POST", | ||
| "path": "/api/2.1/unity-catalog/volumes", | ||
| "body": { | ||
| "catalog_name": "mycatalog", | ||
| "name": "bazname", | ||
| "schema_name": "myschema", | ||
| "volume_type": "MANAGED" | ||
| } | ||
| } | ||
| { | ||
| "method": "POST", | ||
| "path": "/api/2.1/unity-catalog/volumes", | ||
| "body": { | ||
| "catalog_name": "mycatalog", | ||
| "name": "mycatalog.myschema.bazname", | ||
| "schema_name": "myschema", | ||
| "volume_type": "MANAGED" | ||
| } | ||
| } |
43 changes: 43 additions & 0 deletions
43
acceptance/bundle/resource_deps/unresolved_volume_path/out.deploy.requests.terraform.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| { | ||
| "method": "GET", | ||
| "path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.bazname" | ||
| } | ||
| { | ||
| "method": "GET", | ||
| "path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.fooname" | ||
| } | ||
| { | ||
| "method": "GET", | ||
| "path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.mycatalog.myschema.bazname" | ||
| } | ||
| { | ||
| "method": "POST", | ||
| "path": "/api/2.1/unity-catalog/volumes", | ||
| "body": { | ||
| "catalog_name": "mycatalog", | ||
| "comment": "/Volumes/mycatalog/myschema/mycatalog.myschema.bazname", | ||
| "name": "fooname", | ||
| "schema_name": "myschema", | ||
| "volume_type": "MANAGED" | ||
| } | ||
| } | ||
| { | ||
| "method": "POST", | ||
| "path": "/api/2.1/unity-catalog/volumes", | ||
| "body": { | ||
| "catalog_name": "mycatalog", | ||
| "name": "bazname", | ||
| "schema_name": "myschema", | ||
| "volume_type": "MANAGED" | ||
| } | ||
| } | ||
| { | ||
| "method": "POST", | ||
| "path": "/api/2.1/unity-catalog/volumes", | ||
| "body": { | ||
| "catalog_name": "mycatalog", | ||
| "name": "mycatalog.myschema.bazname", | ||
| "schema_name": "myschema", | ||
| "volume_type": "MANAGED" | ||
| } | ||
| } |
6 changes: 6 additions & 0 deletions
6
acceptance/bundle/resource_deps/unresolved_volume_path/out.deploy.terraform.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
|
|
||
| >>> errcode [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! |
17 changes: 17 additions & 0 deletions
17
acceptance/bundle/resource_deps/unresolved_volume_path/out.destroy.direct.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| The following resources will be deleted: | ||
| delete resources.volumes.bar | ||
| delete resources.volumes.baz | ||
| delete resources.volumes.foo | ||
|
|
||
| This action will result in the deletion of the following volumes. | ||
| For managed volumes, the files stored in the volume are also deleted from your | ||
| cloud tenant within 30 days. For external volumes, the metadata about the volume | ||
| is removed from the catalog, but the underlying files are not deleted: | ||
| delete resources.volumes.bar | ||
| delete resources.volumes.baz | ||
| delete resources.volumes.foo | ||
|
|
||
| All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default | ||
|
|
||
| Deleting files... | ||
| Destroy complete! |
17 changes: 17 additions & 0 deletions
17
acceptance/bundle/resource_deps/unresolved_volume_path/out.destroy.terraform.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| The following resources will be deleted: | ||
| delete resources.volumes.bar | ||
| delete resources.volumes.baz | ||
| delete resources.volumes.foo | ||
|
|
||
| This action will result in the deletion of the following volumes. | ||
| For managed volumes, the files stored in the volume are also deleted from your | ||
| cloud tenant within 30 days. For external volumes, the metadata about the volume | ||
| is removed from the catalog, but the underlying files are not deleted: | ||
| delete resources.volumes.bar | ||
| delete resources.volumes.baz | ||
| delete resources.volumes.foo | ||
|
|
||
| All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default | ||
|
|
||
| Deleting files... | ||
| Destroy complete! |
24 changes: 24 additions & 0 deletions
24
acceptance/bundle/resource_deps/unresolved_volume_path/out.destroy_requests.direct.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "method": "DELETE", | ||
| "path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.bazname" | ||
| } | ||
| { | ||
| "method": "DELETE", | ||
| "path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.fooname" | ||
| } | ||
| { | ||
| "method": "DELETE", | ||
| "path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.mycatalog.myschema.bazname" | ||
| } | ||
| { | ||
| "method": "GET", | ||
| "path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.bazname" | ||
| } | ||
| { | ||
| "method": "GET", | ||
| "path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.fooname" | ||
| } | ||
| { | ||
| "method": "GET", | ||
| "path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.mycatalog.myschema.bazname" | ||
| } |
24 changes: 24 additions & 0 deletions
24
acceptance/bundle/resource_deps/unresolved_volume_path/out.destroy_requests.terraform.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "method": "DELETE", | ||
| "path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.bazname" | ||
| } | ||
| { | ||
| "method": "DELETE", | ||
| "path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.fooname" | ||
| } | ||
| { | ||
| "method": "DELETE", | ||
| "path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.mycatalog.myschema.bazname" | ||
| } | ||
| { | ||
| "method": "GET", | ||
| "path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.bazname" | ||
| } | ||
| { | ||
| "method": "GET", | ||
| "path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.fooname" | ||
| } | ||
| { | ||
| "method": "GET", | ||
| "path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.mycatalog.myschema.bazname" | ||
| } |
3 changes: 3 additions & 0 deletions
3
acceptance/bundle/resource_deps/unresolved_volume_path/out.test.toml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.