acc: preserve serialized_dashboard formatting in testserver#5652
Open
pietern wants to merge 7 commits into
Open
acc: preserve serialized_dashboard formatting in testserver#5652pietern wants to merge 7 commits into
pietern wants to merge 7 commits into
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
Contributor
Approval status: pending
|
Collaborator
Integration test reportCommit: f0b7071
22 interesting tests: 13 SKIP, 7 KNOWN, 2 flaky
Top 21 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
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.