Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"pages": [
{
"displayName": "New Page",
"layout": [
{
"position": {
"height": 2,
"width": 6,
"x": 0,
"y": 0
},
"widget": {
"name": "82eb9107",
"textbox_spec": "# I'm a title"
}
},
{
"position": {
"height": 2,
"width": 6,
"x": 0,
"y": 2
},
"widget": {
"name": "ffa6de4f",
"textbox_spec": "Text"
}
}
],
"name": "fdd21a3c"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
bundle:
name: test-bundle-$UNIQUE_NAME

resources:
dashboards:
my_dashboard:
display_name: test-dashboard-$UNIQUE_NAME
file_path: ./dashboard.lvdash.json
warehouse_id: $TEST_DEFAULT_WAREHOUSE_ID

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

32 changes: 32 additions & 0 deletions acceptance/bundle/config-remote-sync/dashboard_etag/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
Deploying resources...
Updating deployment state...
Deployment complete!

=== Modify the dashboard out of band to bump its remote etag
{
"lifecycle_state": "ACTIVE"
}

=== Detect changes: etag drift must not be reported

>>> [CLI] bundle config-remote-sync
No changes detected.


=== Save changes: config must not be modified

>>> [CLI] bundle config-remote-sync --save
No changes detected.


>>> diff.py databricks.yml.backup databricks.yml

>>> [CLI] bundle destroy --auto-approve
The following resources will be deleted:
delete resources.dashboards.my_dashboard

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default

Deleting files...
Destroy complete!
28 changes: 28 additions & 0 deletions acceptance/bundle/config-remote-sync/dashboard_etag/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
}
trap cleanup EXIT

$CLI bundle deploy
dashboard_id=$(read_id.py my_dashboard)

title "Modify the dashboard out of band to bump its remote etag"
echo
# Keep only lifecycle_state: the full response carries a nondeterministic etag
# and update_time that would churn the snapshot.
$CLI lakeview update "$dashboard_id" --json '{"serialized_dashboard": "{}", "warehouse_id": "'$TEST_DEFAULT_WAREHOUSE_ID'"}' | jq '{lifecycle_state}'

title "Detect changes: etag drift must not be reported"
echo
trace $CLI bundle config-remote-sync

title "Save changes: config must not be modified"
echo
cp databricks.yml databricks.yml.backup
trace $CLI bundle config-remote-sync --save
trace diff.py databricks.yml.backup databricks.yml
rm databricks.yml.backup
12 changes: 12 additions & 0 deletions acceptance/bundle/config-remote-sync/dashboard_etag/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Cloud = true
RequiresWarehouse = true

RecordRequests = false

Ignore = [".databricks", "databricks.yml", "databricks.yml.backup"]

[Env]
DATABRICKS_BUNDLE_ENABLE_EXPERIMENTAL_YAML_SYNC = "true"

[EnvMatrix]
DATABRICKS_BUNDLE_ENGINE = ["direct", "terraform"]
Loading
Loading