Skip to content

Add acceptance test for inline serialized_dashboard - #6463

Merged
Sankalp-Mittal merged 15 commits into
mainfrom
sankalp-mittal/dashboards-serialized-inline
Sep 2, 2026
Merged

Add acceptance test for inline serialized_dashboard#6463
Sankalp-Mittal merged 15 commits into
mainfrom
sankalp-mittal/dashboards-serialized-inline

Conversation

@Sankalp-Mittal

Copy link
Copy Markdown
Collaborator

Adds an acceptance test proving that a dashboard whose serialized_dashboard is an inline YAML map (not a string) plans and deploys correctly, and records the create request. The inline map is sent to the API as a JSON string; both the direct and terraform engines produce identical output.

Follow-up from the #6105 discussion.

This pull request and its description were written by Isaac.

Sankalp-Mittal and others added 3 commits September 1, 2026 14:01
Prove that a dashboard whose serialized_dashboard is an inline YAML map
(not a string) plans and deploys correctly, and record that the map is
sent to the API as a JSON string. Both engines produce identical output.

Co-authored-by: Isaac <no-reply@databricks.com>
Deploy a dashboard whose serialized_dashboard is an inline YAML map, then
change a value inside the map and show the plan: the change is detected as
an update (not a recreate). Capture the update request the direct engine
sends, which serializes the inline map to a JSON string.

Co-authored-by: Isaac <no-reply@databricks.com>
Show the machine-readable plan (per engine) for the serialized_dashboard
change instead of recording the update request.

Co-authored-by: Isaac <no-reply@databricks.com>
Comment thread acceptance/bundle/resources/dashboards/serialized-inline/test.toml Outdated
Sankalp-Mittal and others added 3 commits September 1, 2026 18:34
The direct-engine destroy 404s on the injected stale GET and reports
"0 deleted" while terraform reports "1 deleted". That divergence is only
in the cleanup step, so route destroy output to a LOG file instead of
disabling the inherited stale-GET simulation.

Co-authored-by: Isaac <no-reply@databricks.com>
- Change the inline serialized_dashboard value with update_file.py, which
  asserts if the target text is missing instead of silently no-op-ing.
- Deploy the change and test the READPLAN matrix (in-memory vs saved plan);
  both send the same update request.
- Capture the direct-engine update request alongside the per-engine JSON plans.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Comment thread acceptance/bundle/resources/dashboards/change-serialized-inline/script Outdated
Comment thread acceptance/bundle/resources/dashboards/change-serialized-inline/script Outdated
Comment thread acceptance/bundle/resources/dashboards/change-serialized-inline/script Outdated
Comment thread acceptance/bundle/resources/dashboards/change-serialized-inline/script Outdated
Comment thread acceptance/bundle/resources/dashboards/serialized-inline/script Outdated
Comment thread acceptance/bundle/resources/dashboards/serialized-inline/script
Sankalp-Mittal and others added 8 commits September 1, 2026 19:56
- Use replace_ids.py instead of bundle summary + add_repl for the dashboard ID.
- Add the READPLAN matrix; the create request is identical in-memory and from
  a saved plan.

Co-authored-by: Isaac <no-reply@databricks.com>
Encode "update, not recreate" as an executable check instead of a prose comment.

Co-authored-by: Isaac <no-reply@databricks.com>
Drop the direct-only guard and record out.requests.$DATABRICKS_BUNDLE_ENGINE.txt
for both engines. This documents terraform's OUTPUT_ONLY-field echoing instead of
hiding it, following the repo's per-engine-file convention for divergent output.

Co-authored-by: Isaac <no-reply@databricks.com>
The direct plan dumped remote_state (etag, timestamps, and the API's
pretty-printed serialized_dashboard string), which a real workspace formats
differently than the local fake, breaking the cloud run. Project the golden to
just the resource action and the serialized_dashboard old/new diff; keep the
full plan in a tmp file for the READPLAN=1 deploy.

Co-authored-by: Isaac <no-reply@databricks.com>
The real Lakeview API pretty-prints serialized_dashboard and returns a
differently-shaped etag, which the recorded plan golden can't match on a real
workspace. Mark the test Cloud=false and drop the jq projection, dumping the
full plan again (stable against the local fake).

Co-authored-by: Isaac <no-reply@databricks.com>
The inherited MSYS_NO_PATHCONV=1 stops Git-Bash from converting a helper
script's own /c/... path when handing it to python3.exe, so replace_ids.py /
update_file.py / print_requests.py fail to open on Windows. These tests pass no
absolute paths to the CLI (print_requests.py uses the // form), so unset it.

Co-authored-by: Isaac <no-reply@databricks.com>
Comment thread acceptance/bundle/resources/dashboards/change-serialized-inline/script Outdated
Comment thread acceptance/bundle/resources/dashboards/change-serialized-inline/script Outdated
Comment thread acceptance/bundle/resources/dashboards/change-serialized-inline/script Outdated
@@ -0,0 +1,12 @@
bundle:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there something that this test does that change-serialized-inline does not already?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test runs on Cloud=True. This is not done for change-serialized-inline because our testserver and the cloud send json output in different formats (Cloud sends it pretty printed)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, thanks

@Sankalp-Mittal
Sankalp-Mittal added this pull request to the merge queue Sep 2, 2026
Merged via the queue into main with commit a161e5d Sep 2, 2026
33 of 34 checks passed
@Sankalp-Mittal
Sankalp-Mittal deleted the sankalp-mittal/dashboards-serialized-inline branch September 2, 2026 11:56
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.

2 participants