Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions acceptance/bin/update_file.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,9 +20,12 @@
# call update_file.py on that file.
assert filename != "output.txt"

data = open(filename).read()
# newline="" keeps existing endings; text mode on Windows rewrites LF→CRLF
# and makes sync treat the file as changed.
with open(filename, newline="") as fobj:
data = fobj.read()
newdata = data.replace(old, new)
if newdata == data:
sys.exit(f"{old=} not found in {filename=}\n{data}")
with open(filename, "w") as fobj:
with open(filename, "w", newline="") as fobj:
fobj.write(newdata)
7 changes: 7 additions & 0 deletions acceptance/bundle/lifecycle/prevent-destroy/databricks.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,3 +3,10 @@ bundle:

include:
- resources/*.yml

# Exclude harness files so Files: upload counts stay OS-stable.
sync:
exclude:
- "out*"
- "script"
- "test.toml"
8 changes: 4 additions & 4 deletions acceptance/bundle/lifecycle/prevent-destroy/out.direct.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,7 @@ Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/prevent-destroy/default/files...
Error: resources.pipelines.my_pipelines has lifecycle.prevent_destroy set, but the plan calls for this resource to be recreated or destroyed. To avoid this error, disable lifecycle.prevent_destroy for resources.pipelines.my_pipelines

Files: 3 uploaded, 0 deleted
Files: 1 uploaded, 0 deleted

>>> errcode [CLI] bundle plan
recreate pipelines.my_pipelines
Expand All@@ -26,7 +26,7 @@ Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/prevent-destroy/de
Error: resources.pipelines.my_pipelines has lifecycle.prevent_destroy set, but the plan calls for this resource to be recreated or destroyed. To avoid this error, disable lifecycle.prevent_destroy for resources.pipelines.my_pipelines
resources.schemas.my_schema has lifecycle.prevent_destroy set, but the plan calls for this resource to be recreated or destroyed. To avoid this error, disable lifecycle.prevent_destroy for resources.schemas.my_schema

Files: 2 uploaded, 0 deleted
Files: 1 uploaded, 0 deleted

>>> errcode [CLI] bundle plan
recreate pipelines.my_pipelines
Expand All@@ -47,7 +47,7 @@ properties such as the 'catalog' or 'storage' are changed:
recreate resources.pipelines.my_pipelines
Recreated pipelines.my_pipelines
Recreated schemas.my_schema
Files: 3 uploaded, 0 deleted
Files: 2 uploaded, 0 deleted
Resources: 2 created, 0 changed, 2 deleted, 0 unchanged

>>> errcode [CLI] bundle plan
Expand All@@ -69,5 +69,5 @@ properties such as the 'catalog' or 'storage' are changed:
delete resources.pipelines.my_pipelines
Deleted pipelines.my_pipelines
Deleted schemas.my_schema
Files: 1 uploaded, 2 deleted
Files: 0 uploaded, 2 deleted
Resources: 0 created, 0 changed, 2 deleted, 0 unchanged
Original file line numberDiff line numberDiff line change
Expand Up@@ -56,7 +56,7 @@ continue with the plan, either disable lifecycle.prevent_destroy or reduce
the scope of the plan using the -target flag.


Files: 3 uploaded, 0 deleted
Files: 1 uploaded, 0 deleted

>>> errcode [CLI] bundle plan
Error: exit status 1
Expand DownExpand Up@@ -110,7 +110,7 @@ continue with the plan, either disable lifecycle.prevent_destroy or reduce
the scope of the plan using the -target flag.


Files: 2 uploaded, 0 deleted
Files: 1 uploaded, 0 deleted

>>> errcode [CLI] bundle plan
recreate pipelines.my_pipelines
Expand All@@ -131,7 +131,7 @@ properties such as the 'catalog' or 'storage' are changed:
recreate resources.pipelines.my_pipelines
Recreated pipelines.my_pipelines
Recreated schemas.my_schema
Files: 3 uploaded, 0 deleted
Files: 2 uploaded, 0 deleted
Resources: 2 created, 0 changed, 2 deleted, 0 unchanged

>>> errcode [CLI] bundle plan
Expand All@@ -153,5 +153,5 @@ properties such as the 'catalog' or 'storage' are changed:
delete resources.pipelines.my_pipelines
Deleted pipelines.my_pipelines
Deleted schemas.my_schema
Files: 1 uploaded, 2 deleted
Files: 0 uploaded, 2 deleted
Resources: 0 created, 0 changed, 2 deleted, 0 unchanged
2 changes: 1 addition & 1 deletion acceptance/bundle/lifecycle/prevent-destroy/output.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,7 +12,7 @@ Validation OK!
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/prevent-destroy/default/files...
Created pipelines.my_pipelines
Created schemas.my_schema
Files: 8 uploaded, 0 deleted
Files: 5 uploaded, 0 deleted
Resources: 2 created, 0 changed, 0 deleted, 0 unchanged

>>> errcode [CLI] bundle plan
Expand Down
Loading