acc: preserve serialized_dashboard formatting in testserver#5652
Merged
Conversation
The lakeview testserver fake round-tripped serialized_dashboard through json.Unmarshal/Marshal, collapsing whitespace and reordering keys. The real backend stores and returns the serialized dashboard verbatim, modulo the documented pageType injection and dataset catalog/schema overrides. Preserve the caller's original formatting when no mutation is needed, and use indented marshaling otherwise to match cloud's pretty-printing. This lets the dashboards/generate_inplace acceptance test run locally; flip its Local flag and re-baseline serialized_dashboard formatting across the dashboard test family. Co-authored-by: Isaac
Collaborator
Integration test reportCommit: 98789b7
20 interesting tests: 13 SKIP, 7 KNOWN
Top 4 slowest tests (at least 2 minutes):
|
The previous commit pretty-printed the serialized dashboard whenever it was mutated (pageType/dataset injection), which re-baselined goldens in local-only tests (bundle/migrate/dashboards, bundle/generate/dashboard-inplace) for a formatting cloud is never checked against. Keep the mutation path compact (its original behavior) and only return the dashboard verbatim when nothing is mutated. This narrows the change to the verbatim case and regenerates the one remaining missed golden (bundle/generate/dashboard-inplace). Co-authored-by: Isaac
The lakeview testserver fake preserves the caller's serialized_dashboard
verbatim when no mutation is needed, but dropped cloud's trailing-newline
behavior. Cloud terminates the stored dashboard with a single newline even
when it otherwise preserves formatting, so an out-of-band update sending "{}"
comes back as "{}\n". Re-add the newline in the verbatim branch and update
the detect-change golden to match.
Co-authored-by: Isaac
Compute the dashboard body once (verbatim when unmutated, re-marshaled otherwise) and apply cloud's trailing-newline rule in a single place instead of two. Co-authored-by: Isaac
The lakeview update in this test sends serialized_dashboard "{"a":"b"}",
which cloud stores with a trailing newline like every other dashboard.
Regenerate the golden to match the testserver's now-faithful behavior.
Co-authored-by: Isaac
The simple/simple_outside_bundle_root/simple_syncroot inputs were reverted to
unformatted JSON ({ }), which the verbatim path now preserves; their output
goldens still expected the collapsed form ({}). Regenerate them.
Co-authored-by: Isaac
…-ucws)
Captured the serialized_dashboard goldens from a real cloud run: cloud compacts
insignificant whitespace ({ } -> {}) on the create/get round-trip, and the
direct-engine plan shows the resulting etag-based skip drift (local "{ }\n" vs
remote "{}\n"). These are the source of truth; the testserver fake is updated
separately to match.
Co-authored-by: Isaac
Cloud stores the serialized dashboard verbatim unless it modifies the content,
with one exception: an empty object is canonicalized from "{ }" to "{}" (verified
by capturing goldens on aws-prod-ucws). Reproduce that in the fake: re-marshal
when mutated, return "{}" for an empty object, otherwise preserve the input
verbatim. This matches the locked cloud goldens for the whole dashboards family.
Co-authored-by: Isaac
Fold the empty-object case into the marshal branch: json.Marshal of the parsed
content already yields "{}" for an empty object, so a single
"if mutated || empty { marshal }" replaces the three-way switch. No behavior
change; the full acceptance suite stays green.
Co-authored-by: Isaac
denik
approved these changes
Jun 22, 2026
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.
The fake now returns
serialized_dashboardverbatim when it isn't mutated, instead of always re-marshaling it (which collapsed whitespace and reordered keys); the mutation path (pageType/dataset injection) keeps its original compact output. This letsdashboards/generate_inplacerun locally.This pull request and its description were written by Isaac.