Serialize inline serialized_dashboard to a JSON string early - #6471
Open
Sankalp-Mittal wants to merge 4 commits into
Open
Serialize inline serialized_dashboard to a JSON string early#6471Sankalp-Mittal wants to merge 4 commits into
Sankalp-Mittal wants to merge 4 commits into
Conversation
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
…ized-inline' into sankalp-mittal/dashboards-serialize-early
…ized-inline' into sankalp-mittal/dashboards-serialize-early
…ized-inline' into sankalp-mittal/dashboards-serialize-early
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.