Skip to content

direct: detect stale dashboard publishes via publish/update timestamps - #6119

Open
denik wants to merge 2 commits into
mainfrom
denik/dashboard-published-timestamps
Open

direct: detect stale dashboard publishes via publish/update timestamps#6119
denik wants to merge 2 commits into
mainfrom
denik/dashboard-published-timestamps

Conversation

@denik

@denik denik commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Changes

Detect stale dashboard publishes in the direct engine by comparing the published
revision_create_time against the draft update_time, instead of treating "a
published version exists" as "the published content is current".

A dashboard is deployed as a draft update followed by a separate publish. Once
published, GetPublished keeps returning the previous revision even after the
draft changes, so the old published = (GetPublished succeeds) check could not
tell that the published content was stale. Now published is true only when
revision_create_time >= update_time; a draft updated without a republish reads
as published=false and the planner surfaces a pending republish.

Why not the draft etag

Verified on AWS, GCP and Azure: the draft etag tracks the serialized dashboard
content
, so a metadata-only draft change (e.g. display_name) with an unchanged
serialized payload does not bump the etag — while update_time still advances.
So an etag-based "did the draft change since we published" check would miss that
case; the revision_create_time vs update_time comparison does not. A publish
always leaves revision_create_time >= update_time, so there is no
perpetual-republish risk.

Scope

This improves detection only. Recovering a stale publish via a plain re-deploy
also requires persisting state before the publish call (so the etag-drift
"modified remotely" guard does not block); that is a separate change. Here, a
stale publish is detected in the plan but recovery may still require --force
(unchanged from today).

Tests

New regression test republish-after-draft-update: an out-of-band draft update
makes bundle plan report published needs an update (it did not before). Goldens
updated for detect-change and publish-failure-stale-content. The testserver now
emits strictly-increasing timestamps so update/publish ordering is deterministic.

DoRead computed a dashboard's published state as "does GetPublished succeed",
but once a dashboard is published GetPublished keeps returning the previous
revision even after the draft is updated, so that check cannot tell whether the
published content is current. Compare the published revision_create_time against
the draft update_time instead: published is true only when GetPublished succeeds
AND revision_create_time >= update_time. When the draft was updated without a
republish, published becomes false, which differs from the desired true and the
planner schedules a republish.

Verified on AWS, GCP, Azure and dogfood: a publish always leaves
revision_create_time >= update_time, and a draft update pushes update_time ahead
until the next publish (so there is no perpetual-republish risk). The draft etag,
by contrast, does not reliably change on a display-name update on cloud, so it
cannot be used for this.

The testserver now emits strictly-increasing RFC3339Nano timestamps
(nextTimestamp) so update/publish ordering is deterministic. published is also
excluded from config-remote-sync as an internal state field.

Co-authored-by: Isaac
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

8 files changed
Suggested: @pietern
Also eligible: @shreyas-goenka, @janniklasrose, @andrewnester, @anton-107, @lennartkats-db

/bundle/ - needs approval

Files: bundle/configsync/defaults.go, bundle/direct/dresources/dashboard.go
Suggested: @pietern
Also eligible: @shreyas-goenka, @janniklasrose, @andrewnester, @anton-107, @lennartkats-db

General files (require maintainer)

Files: libs/testserver/dashboards.go, libs/testserver/fake_workspace.go
Based on git history:

  • @pietern -- recent work in libs/testserver/, bundle/direct/dresources/

Any maintainer (@andrewnester, @anton-107, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db) can approve all areas.
See OWNERS for ownership rules.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 4334fe9

Run: 30639738142

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 2 1 1 4 316 1067 7:57
🟨​ aws windows 1 2 1 4 318 1065 7:11
🟨​ azure linux 3 1 4 316 1066 9:17
🟨​ azure windows 3 1 4 318 1064 9:04
💚​ gcp linux 1 5 316 1067 6:29
💚​ gcp windows 1 5 318 1065 6:51
8 interesting tests: 4 SKIP, 3 KNOWN, 1 RECOVERED
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestFetchRepositoryInfoAPI_FromRepo 🟨​K 🔄​f 🟨​K 🟨​K 🙈​S 🙈​S
🟨​ TestFetchRepositoryInfoAPI_FromRepo/root 🟨​K 🔄​f 🟨​K 🟨​K
🟨​ TestFetchRepositoryInfoAPI_FromRepo/subdir 🔄​f 🟨​K 🟨​K 🟨​K
Top 7 slowest tests (at least 2 minutes):
duration env testname
4:18 gcp windows TestAccept
2:51 aws windows TestAccept
2:51 azure windows TestAccept
2:35 azure windows TestAccept/bundle/resources/dashboards/detect-change/DATABRICKS_BUNDLE_ENGINE=direct
2:15 azure windows TestAccept/bundle/resources/dashboards/detect-change/DATABRICKS_BUNDLE_ENGINE=terraform
2:15 azure windows TestFilerWorkspaceFilesExtensionsDelete
2:03 aws windows TestAccept/bundle/resources/dashboards/detect-change/DATABRICKS_BUNDLE_ENGINE=terraform

… update

Deploys a dashboard, makes an out-of-band draft update without republishing, and
asserts `bundle plan` reports the dashboard's published state needs an update
(published: {old: true, remote: false}). Before the timestamp-based fix, DoRead
reported published=true (GetPublished still returns the previous revision), so
the stale publish was missed and the plan showed no change.

Direct engine only: published is a direct-engine state field.

Co-authored-by: Isaac
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.

2 participants