Skip to content
Merged
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
1 change: 1 addition & 0 deletions acceptance/bundle/deployment/bind/dashboard/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions acceptance/bundle/deployment/bind/dashboard/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
Updating deployment state...
Successfully bound dashboard with an id '[DASHBOARD_ID]'
Run 'bundle deploy' to deploy changes to your workspace

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
Deploying resources...
Updating deployment state...
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ Run 'bundle deploy' to deploy changes to your workspace
recreate dashboards.dashboard1

Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged

>>> errcode [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...

This action will result in the deletion or recreation of the following dashboards.
Expand All @@ -27,8 +25,6 @@ Exit code: 1

>>> [CLI] bundle deployment unbind dashboard1
Updating deployment state...

>>> [CLI] bundle deploy --auto-approve
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
Deploying resources...
Updating deployment state...
Expand Down
7 changes: 5 additions & 2 deletions acceptance/bundle/deployment/bind/dashboard/recreation/script
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ add_repl.py $ETAG ETAG
json_in_json_normalize.py out.state_after_bind.$DATABRICKS_BUNDLE_ENGINE.json

trace $CLI bundle plan
trace errcode $CLI bundle deploy
$CLI bundle plan -o json > tmp.plan.json
errcode $CLI bundle deploy $(readplanarg tmp.plan.json)
Comment thread
Sankalp-Mittal marked this conversation as resolved.

trace $CLI bundle deployment unbind dashboard1

trace $CLI bundle deploy --auto-approve
# Re-plan after unbind: the plan saved above no longer matches state.
$CLI bundle plan -o json > tmp.plan_after_unbind.json
$CLI bundle deploy --auto-approve $(readplanarg tmp.plan_after_unbind.json)

trace $CLI lakeview get "${DASHBOARD_ID}" | jq '{display_name, lifecycle_state}'
5 changes: 4 additions & 1 deletion acceptance/bundle/deployment/bind/dashboard/script
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ trap cleanupRemoveDashboard EXIT

trace $CLI bundle deployment bind dashboard1 "${DASHBOARD_ID}" --auto-approve

trace $CLI bundle deploy
# Bind writes state without going through DoCreate/DoUpdate, so a saved-plan deploy after
# a bind must still send the full serialized_dashboard; the lakeview get below reads it back.
$CLI bundle plan -o json > tmp.plan.json
$CLI bundle deploy $(readplanarg tmp.plan.json)

trace $CLI lakeview get "${DASHBOARD_ID}" | jq --sort-keys '{display_name, lifecycle_state, path, parent_path, serialized_dashboard} | .serialized_dashboard |= fromjson'

Expand Down
7 changes: 7 additions & 0 deletions acceptance/bundle/deployment/bind/dashboard/test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ Local = true
Cloud = true
RequiresWarehouse = true

Ignore = ["tmp.plan.json", "tmp.plan_after_unbind.json"]

# Bind writes state without going through DoCreate/DoUpdate, so a deploy from a saved
# plan after binding must still send the full serialized_dashboard. Inherited by
# recreation/, whose script also deploys from a saved plan.
EnvMatrix.READPLAN = ["", "1"]

[[Repls]]
Old = "[0-9a-f]{32}"
New = "[DASHBOARD_ID]"

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
create dashboards.my_dashboard

Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/change-serialized-dashboard-[UNIQUE_NAME]/default/files...
Deploying resources...
Updating deployment state...
Expand All @@ -26,8 +24,6 @@ Deployment complete!
update dashboards.my_dashboard

Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/change-serialized-dashboard-[UNIQUE_NAME]/default/files...
Deploying resources...
Updating deployment state...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ deploy_dashboard() {
envsubst < databricks.yml.tmpl > databricks.yml
envsubst < dashboard.tmpl > dash.lvdash.json
trace $CLI bundle plan
trace $CLI bundle deploy
$CLI bundle plan -o json > tmp.plan.$PAGE_NAME.json
$CLI bundle deploy $(readplanarg tmp.plan.$PAGE_NAME.json)
dashboard_id=$($CLI bundle summary --output json | jq -r '.resources.dashboards.my_dashboard.id')

# Wait out eventual consistency: retry until the current page is visible (the read
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
Ignore = [
"databricks.yml",
"dash.lvdash.json",
"tmp.plan.name1.json",
"tmp.plan.name2.json",
]

# Deploying a saved plan must send the same full serialized_dashboard as an
# in-memory plan; both variants share the request goldens below.
EnvMatrix.READPLAN = ["", "1"]

[Env]
# MSYS2 automatically converts absolute paths like /Users/$username/$UNIQUE_NAME to
# C:/Program Files/Git/Users/$username/UNIQUE_NAME before passing it to the CLI
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-dashboard-nested-folders-[UNIQUE_NAME]/default/files...
Deploying resources...
Updating deployment state...
Expand Down
3 changes: 2 additions & 1 deletion acceptance/bundle/resources/dashboards/nested-folders/script
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ cleanup() {
}
trap cleanup EXIT

trace $CLI bundle deploy
$CLI bundle plan -o json > tmp.plan.json
$CLI bundle deploy $(readplanarg tmp.plan.json)
DASHBOARD_ID=$($CLI bundle summary --output json | jq -r '.resources.dashboards.dashboard1.id')

# Capture the dashboard ID as a replacement.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ RunsOnDbr = true
Ignore = [
"databricks.yml",
"resources/dashboards.yml",
"tmp.plan.json",
]

# Deploying a saved plan must send the same full serialized_dashboard, which the
# lakeview get in the script reads back.
EnvMatrix.READPLAN = ["", "1"]


[[Repls]]
# Windows:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/publish-failure-cleans-up-dashboard/default/files...
Deploying resources...
Error: cannot create resources.dashboards.dashboard1: Warehouse doesnotexist does not exist (400 RESOURCE_DOES_NOT_EXIST)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/publish-failure-cleans-up-dashboard/default/files...
Deploying resources...
Error: terraform apply: exit status 1
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ export DASHBOARD_DISPLAY_NAME="test bundle-deploy-dashboard $UNIQUE_NAME)"
envsubst < databricks.yml.tmpl > databricks.yml

# Deploy the dashboard. The dashboard will be created but publish will fail because the warehouse does not exist.
errcode trace $CLI bundle deploy &> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt
$CLI bundle plan -o json > tmp.plan.json
errcode $CLI bundle deploy $(readplanarg tmp.plan.json) &> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt

trace $CLI bundle summary

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ Cloud = false
Local = true
RecordRequests = true

Ignore = ["tmp.plan.json"]

# Applying a saved plan must reach the same publish failure and the same cleanup
# DELETE as an in-memory plan; both variants share out.dashboardrequests.txt.
EnvMatrix.READPLAN = ["", "1"]

[[Server]]
Pattern = "POST /api/2.0/lakeview/dashboards/{dashboard_id}/published"
Response.StatusCode = 400
Expand Down
Loading