Skip to content

Commit 35de00c

Browse files
bundle/deploy/lock: wire DMS into NewDeploymentLock via experimental.use_managed_state
When experimental.use_managed_state is set in databricks.yml, NewDeploymentLock now creates a metadataServiceLock alongside the workspace-filesystem lock. Acquire calls DMS CreateVersion after acquiring the file lock; Release calls DMS CompleteVersion before releasing it. Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
1 parent de9adfd commit 35de00c

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

bundle/config/experimental.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ type Experimental struct {
4242
// Eventually this can be made the default once we have native CRUD in DABs
4343
// at which point we can deprecate or remove this field all together.
4444
SkipNamePrefixForSchema bool `json:"skip_name_prefix_for_schema,omitempty"`
45+
46+
// UseManagedState enables Deployment Metadata Service (DMS) integration.
47+
// When set, each deployment registers a versioned record with the DMS API,
48+
// providing server-side deployment history and concurrency control via
49+
// the server-side version counter.
50+
UseManagedState bool `json:"use_managed_state,omitempty"`
4551
}
4652

4753
type Python struct {

bundle/deploy/lock/lock.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ func NewDeploymentLock(ctx context.Context, b *bundle.Bundle, goal Goal) *Deploy
5757
if enabled {
5858
l.wfs.client = b.WorkspaceClient(ctx)
5959
}
60+
if b.Config.Experimental != nil && b.Config.Experimental.UseManagedState {
61+
l.dms = newMetadataServiceLock(b, goal)
62+
}
6063
return l
6164
}
6265

0 commit comments

Comments
 (0)