Skip to content

acc: preserve serialized_dashboard formatting in testserver#5652

Merged
pietern merged 11 commits into
mainfrom
local-dashboards-generate-inplace
Jun 22, 2026
Merged

acc: preserve serialized_dashboard formatting in testserver#5652
pietern merged 11 commits into
mainfrom
local-dashboards-generate-inplace

Conversation

@pietern

@pietern pietern commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

The fake now returns serialized_dashboard verbatim 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 lets dashboards/generate_inplace run locally.

This pull request and its description were written by Isaac.

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
@pietern pietern temporarily deployed to test-trigger-is June 18, 2026 15:12 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is June 18, 2026 15:12 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 98789b7

Run: 27951785889

Env 🟨​KNOWN 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 13 247 1018 5:51
🟨​ aws windows 7 13 249 1016 8:48
💚​ aws-ucws linux 7 13 337 934 5:13
💚​ aws-ucws windows 7 13 339 932 5:50
💚​ azure linux 1 15 250 1016 4:27
💚​ azure windows 1 15 252 1014 5:27
💚​ azure-ucws linux 1 15 342 930 5:35
💚​ azure-ucws windows 1 15 344 928 5:35
💚​ gcp linux 1 15 249 1018 4:15
💚​ gcp windows 1 15 251 1016 5:01
20 interesting tests: 13 SKIP, 7 KNOWN
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🙈​ TestAccept/bundle/resources/postgres_branches/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/replace_existing 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/update_protected 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/without_branch_id 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_projects/update_display_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
Top 4 slowest tests (at least 2 minutes):
duration env testname
3:09 azure-ucws windows TestAccept
3:08 gcp windows TestAccept
3:07 aws-ucws windows TestAccept
3:06 azure windows TestAccept

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
@pietern pietern temporarily deployed to test-trigger-is June 18, 2026 16:50 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is June 18, 2026 16:50 — with GitHub Actions Inactive
pietern added 2 commits June 19, 2026 11:23
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
@pietern pietern temporarily deployed to test-trigger-is June 19, 2026 09:41 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is June 19, 2026 09:41 — with GitHub Actions Inactive
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
@pietern pietern temporarily deployed to test-trigger-is June 19, 2026 09:42 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is June 19, 2026 09:42 — with GitHub Actions Inactive
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
@pietern pietern temporarily deployed to test-trigger-is June 19, 2026 09:46 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is June 19, 2026 09:46 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is June 19, 2026 10:03 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is June 19, 2026 10:03 — with GitHub Actions Inactive
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
@pietern pietern temporarily deployed to test-trigger-is June 22, 2026 09:30 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is June 22, 2026 09:30 — with GitHub Actions Inactive
@pietern pietern marked this pull request as draft June 22, 2026 09:33
pietern added 2 commits June 22, 2026 13:53
…-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
@pietern pietern temporarily deployed to test-trigger-is June 22, 2026 12:05 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is June 22, 2026 12:05 — with GitHub Actions Inactive
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
@pietern pietern temporarily deployed to test-trigger-is June 22, 2026 12:13 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is June 22, 2026 12:13 — with GitHub Actions Inactive
@pietern pietern marked this pull request as ready for review June 22, 2026 12:17
@pietern pietern enabled auto-merge June 22, 2026 12:18
@pietern pietern requested a review from denik June 22, 2026 12:18
@pietern pietern added this pull request to the merge queue Jun 22, 2026
Merged via the queue into main with commit 2251e9c Jun 22, 2026
27 checks passed
@pietern pietern deleted the local-dashboards-generate-inplace branch June 22, 2026 13:04
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.

3 participants