Skip to content

Commit dccd2d0

Browse files
bundle: add bundle.managed_state config field + DMS test server
Introduce the managed-state configuration gate that future commits will use to swap deployment locking (and, later, resource state management) between the historical workspace-filesystem implementation and the new Deployment Metadata Service (DMS) implementation. The gate mirrors the existing bundle.engine pattern: - bundle/config/managedstate/managedstate.go exposes the DATABRICKS_BUNDLE_MANAGED_STATE env var, a Default constant, and a Setting struct with location-aware source attribution. - config.Bundle.ManagedState (json:"managed_state") is the bundle config knob. - cmd/bundle/utils.ResolveManagedStateSetting layers config > env > Default with file/line source attribution. Also lands the in-memory bundle deployment metadata service test fixture (libs/testserver/deployment_metadata.go and route registrations) so a follow-up that wires the real DMS-backed lock can add its acceptance tests without further test-infra churn. Acceptance coverage: - acceptance/bundle/managed-state/gate-config asserts the config field surfaces through bundle validate -o json. - acceptance/bundle/managed-state/gate-env documents that the env var deliberately does not mutate validated config (it is consumed lazily at deploy/destroy/bind/unbind time). No behavior changes for existing bundles -- nothing yet consumes the new setting.
1 parent 09f9090 commit dccd2d0

22 files changed

Lines changed: 731 additions & 1 deletion

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
bundle:
2+
name: test-managed-state-gate-config
3+
managed_state: true
4+
5+
targets:
6+
default:
7+
default: true

acceptance/bundle/managed-state/gate-config/out.test.toml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
>>> [CLI] bundle validate -o json
3+
true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
trace $CLI bundle validate -o json | jq '.bundle.managed_state'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ignore = [".databricks"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
bundle:
2+
name: test-managed-state-gate-env
3+
4+
targets:
5+
default:
6+
default: true

acceptance/bundle/managed-state/gate-env/out.test.toml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
>>> DATABRICKS_BUNDLE_MANAGED_STATE=true [CLI] bundle validate -o json
3+
null
4+
5+
>>> DATABRICKS_BUNDLE_MANAGED_STATE=false [CLI] bundle validate -o json
6+
null
7+
8+
>>> [CLI] bundle validate -o json
9+
null
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# The env var does not surface in bundle config dumps; it is consumed lazily
2+
# at deploy/destroy/bind/unbind time via ResolveManagedStateSetting. This test
3+
# pins that contract by showing the env var leaves .bundle.managed_state
4+
# unset in the validated config, regardless of the env var value.
5+
trace DATABRICKS_BUNDLE_MANAGED_STATE=true $CLI bundle validate -o json | jq '.bundle.managed_state'
6+
trace DATABRICKS_BUNDLE_MANAGED_STATE=false $CLI bundle validate -o json | jq '.bundle.managed_state'
7+
trace $CLI bundle validate -o json | jq '.bundle.managed_state'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ignore = [".databricks"]

0 commit comments

Comments
 (0)