Skip to content

acc: read recorded ids and state from the deployment metadata service - #6503

Closed
shreyas-goenka wants to merge 1 commit into
isaac/dms-dual-statefrom
isaac/dms-state-helpers
Closed

acc: read recorded ids and state from the deployment metadata service#6503
shreyas-goenka wants to merge 1 commit into
isaac/dms-dual-statefrom
isaac/dms-state-helpers

Conversation

@shreyas-goenka

Copy link
Copy Markdown
Contributor

Changes

Stacked on #6475 (do not merge before it). read_id.py, replace_ids.py and read_state.py read the direct-engine state file; while a bundle records deployment history the service owns the resource set, so they now ask it instead. New acceptance/bin/dms_resources.py resolves the deployment from the workspace node the service registers under the state path (the node's object id is the deployment id, per libs/dms/resolve.go) and lists its resources, which carry both resource_id and the recorded state.

Why

Groundwork for making resources.json a hollow marker while recording: the file would carry only its header, and ids/state would come from the service.

Tests

WIP — pushed so it can be tried out, not ready to merge. bundle/resources/schemas/update passes under both DMS variants, reading state and id from the service. Three known blockers:

  1. Resolving the remote state path runs bundle validate, which fails for tests that deploy with --var or other flags the helper cannot know — bundle/resources/secrets/* abort.
  2. A hollow state file breaks bundle generate (and by inspection bind and configsync): they open the state with no DMS client and read __id__ from it, so generate calls GET /api/2.0/lakeview/dashboards/ with an empty id.
  3. Switching source is not a drop-in for every resource — the recorded state differs from the file's for secrets.

With the state file left intact (as in #6475), the suite is green apart from bundle/resources/{secrets/*,pipelines/update,apps/job_permissions} plus the pre-existing offline templates/lakeflow-integrations.

This PR was written by Claude Code.

WIP. The id helpers read the direct-engine state file, which is the wrong source
while a bundle records deployment history: the service owns the resource set. Add
dms_resources.get_resources, which resolves the deployment from the workspace node
the service registers and lists its resources, and have read_id, replace_ids and
read_state use it when recording is on.

Not ready: resolving the remote state path runs "bundle validate", which fails for
tests that deploy with --var or other flags the helper cannot know (see
bundle/resources/secrets/*). And a hollow state file - the reason for reading from
the service at all - breaks "bundle generate", bind and configsync, which open the
state with no DMS client and need the resource ids from it.

Co-authored-by: Isaac <no-reply@databricks.com>
@shreyas-goenka

Copy link
Copy Markdown
Contributor Author

Folded into #6475 so there is a single PR on top of #6094.

@shreyas-goenka
shreyas-goenka deleted the isaac/dms-state-helpers branch September 2, 2026 22:48
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