Skip to content

bundle: keep resources.json in step with DMS, marked by a state feature - #6475

Draft
shreyas-goenka wants to merge 1 commit into
isaac/pr6052-fixesfrom
isaac/dms-dual-state
Draft

bundle: keep resources.json in step with DMS, marked by a state feature#6475
shreyas-goenka wants to merge 1 commit into
isaac/pr6052-fixesfrom
isaac/dms-dual-state

Conversation

@shreyas-goenka

Copy link
Copy Markdown
Contributor

Changes

Stacked on #6094. The state file keeps tracking every resource the service records, and now says so: recording writes the record_deployment_history feature into resources.json (state_version: 3, using the feature-flag scaffolding already there). The migration guard now keys off that marker instead of "has any resources", so a state this CLI recorded is accepted and only an unmarked one is refused.

Why

A CLI without this feature would otherwise deploy over a recorded deployment and leave the service behind. The feature list is exactly the existing forward-compat gate for that: an unaware CLI refuses the state and tells the user to upgrade. Keying the guard off the marker also makes the state file a usable fallback when the deployment is gone — the resource is updated rather than created a second time.

Tests

bundle/dms/record shows resources.json carrying the marker alongside the full resource set; bundle/dms/existing-state covers both sides of the guard; bundle/state/feature_flags covers a marked state loading with recording off. Unit test for the known-vs-unknown feature split. Full acceptance suite green apart from bundle/templates/lakeflow-integrations, which fails identically on this PR's base (no network for a pypi download).

This PR was written by Claude Code.

@shreyas-goenka
shreyas-goenka force-pushed the isaac/dms-dual-state branch 2 times, most recently from 7047d22 to 1fd16ac Compare September 2, 2026 02:03
@shreyas-goenka
shreyas-goenka force-pushed the isaac/pr6052-fixes branch 2 times, most recently from a5b1a71 to 58257c8 Compare September 2, 2026 02:30
@shreyas-goenka
shreyas-goenka force-pushed the isaac/dms-dual-state branch 5 times, most recently from cee981f to f7d92ee Compare September 2, 2026 13:03
@shreyas-goenka
shreyas-goenka force-pushed the isaac/dms-dual-state branch 3 times, most recently from 855650e to 0af021f Compare September 2, 2026 14:16
Recording made the service the source of truth for resource state, but the
state file was still written on every deploy. Mark it as depending on the
recording feature so an unaware CLI refuses it instead of deploying over a
deployment it would leave the service behind on, and use the marker rather
than "has any resources" to decide whether an existing state can be recorded.

While recording, the file's resource set is never read back: the service is
asked on every open, and holding no deployment means the resources are created
again. Turning recording off for a marked deployment is refused. The WAL needs
no special handling - whatever a replay rebuilds is replaced by what the
service holds.

Two tests that seed a state file now run with recording on; the ones that
cannot are opted out with their real reasons recorded.

Co-authored-by: Isaac <no-reply@databricks.com>
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.

1 participant