Serialize inline serialized_dashboard to a JSON string early - #6471
Open
Sankalp-Mittal wants to merge 29 commits into
Open
Serialize inline serialized_dashboard to a JSON string early#6471Sankalp-Mittal wants to merge 29 commits into
Sankalp-Mittal wants to merge 29 commits into
Conversation
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>
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>
Contributor
Approval status: pending
|
Marshal an inline (structured) serialized_dashboard to a JSON string in phases.Initialize, mirroring ConfigureGenieSpaceSerializedSpace, so the value is always a plain string downstream. A map left in config vs a JSON round-trip in state decode ints differently (Go int vs float64), which made the direct engine report false serialized_dashboard drift on every plan; the remote also comes back serialized, so a deep diff can't converge. - ConfigureDashboardSerializedDashboard now rejects setting both file_path and serialized_dashboard, and marshals an inline map/sequence to a JSON string (string/nil pass through, other kinds error). Keeps the file_path read. - prepareDashboardRequest and the tfdyn converter now assume a string; the map-marshal branches are removed. Co-authored-by: Isaac <no-reply@databricks.com>
Sankalp-Mittal
force-pushed
the
sankalp-mittal/dashboards-serialize-early
branch
from
September 1, 2026 19:30
c319d46 to
484300e
Compare
- 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>
…ized-inline' into sankalp-mittal/dashboards-serialize-early
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>
…ized-inline' into sankalp-mittal/dashboards-serialize-early
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>
…ized-inline' into sankalp-mittal/dashboards-serialize-early
…ized-inline' into sankalp-mittal/dashboards-serialize-early
Co-authored-by: Isaac <no-reply@databricks.com>
denik
reviewed
Sep 2, 2026
denik
reviewed
Sep 2, 2026
Base automatically changed from
sankalp-mittal/dashboards-serialized-inline
to
main
September 2, 2026 11:56
…ards-serialize-early # Conflicts: # acceptance/bundle/resources/dashboards/change-serialized-inline/out.plan.direct.json
denik
reviewed
Sep 2, 2026
The "inline sequence is rejected" case was missing the trailing comma after its struct literal, a syntax error that failed to compile the whole resourcemutator_test package and broke lint and every task test job. Co-authored-by: Isaac <no-reply@databricks.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Marshal an inline (structured)
serialized_dashboardto a JSON string inphases.Initialize, mirroringConfigureGenieSpaceSerializedSpace, so the value is always a plain string by the time the deploy engine sees it.Why: a map left in config versus a JSON round-trip in state decode integers differently (Go
intvsfloat64), so the direct engine reported falseserialized_dashboarddrift on every plan. The remote also comes back serialized, so a deep diff of a map against a string can never converge. Normalizing to a string up front makes config-side and state-side carry the same value.Changes
configure_dashboards_serialized_dashboard.go— reject setting bothfile_pathandserialized_dashboard; switch on the inline value kind (string/nil/invalid pass through, map/sequence →json.Marshal, other → error). Keeps the existingfile_pathread.configure_dashboards_serialized_dashboard_test.go— the first test for this mutator (7 cases, mirroring the genie mutator's test).dashboard.goprepareDashboardRequest— dropped the map-marshal branch; anil/string/default type switch, mirroringprepareGenieSpaceRequest.convert_dashboard.go— removed the now-deadmarshalSerializedDashboard(convert.Normalizemaps the string straight onto the schema's string field) and its call.convert_dashboard_test.goandall_test.goupdated to the always-string reality.Plan-output change
The direct-engine plan for the
change-serialized-inlineacceptance test now showsserialized_dashboardas a JSON string innew_state.valueandchanges.old/new, instead of a structured map — so they're comparable to the remote string and the false drift is gone. The terraform variant and the create-path test are unchanged (tfdyn already marshaled to a string).Notes
sankalp-mittal/dashboards-serialized-inline(Add acceptance test for inline serialized_dashboard #6463).fmt,lint-q(0 issues),go vet, full build, unit tests, and the dashboards/migrate/validate acceptance suites all pass.This pull request and its description were written by Isaac.