bundle: add bundle.managed_state config field + DMS test server#5333
Draft
shreyas-goenka wants to merge 1 commit into
Draft
bundle: add bundle.managed_state config field + DMS test server#5333shreyas-goenka wants to merge 1 commit into
shreyas-goenka wants to merge 1 commit into
Conversation
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.
c52df0c to
dccd2d0
Compare
Collaborator
|
Commit: dccd2d0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Introduce the managed-state configuration gate that future commits (starting with #5331) 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.enginepattern:bundle/config/managedstate/managedstate.goexposes theDATABRICKS_BUNDLE_MANAGED_STATEenv var, aDefaultconstant, and aSettingstruct with location-aware source attribution.FromEnvis tolerant of boolean spelling (yes/no/y/nin addition tostrconv.ParseBoolspellings).config.Bundle.ManagedState(json:"managed_state") is the bundle config knob.cmd/bundle/utils.ResolveManagedStateSettinglayers config > env > Default with file/line source attribution.Also lands the in-memory bundle deployment metadata service test fixture (
libs/testserver/deployment_metadata.goand route registrations) so the follow-up that wires the real DMS-backed lock can add its acceptance tests without further test-infra churn.Tests
bundle/config/managedstate: unit coverage for env-var parsing, including boolean-spelling tolerance and invalid-value error.cmd/bundle/utils:ResolveManagedStateSettingpriority tests mirroringResolveEngineSetting.acceptance/bundle/managed-state/gate-config: asserts the config field surfaces throughbundle 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.Behavior
No behavior changes for existing bundles -- nothing yet consumes the new setting. The DMS-backed lock implementation that does consume it lands in #5331, which is rebased on top of this branch.
Stack
bundle: extract DeploymentLock interface + workspace filesystem impl)