bundle: add direct_with_history engine type#5365
Draft
shreyas-goenka wants to merge 10 commits into
Draft
Conversation
Adds the env-var building block that opts a bundle into the deployment metadata service (DMS) for locking and resource-state management. The flag itself has no consumers yet — wiring it into the lock and statemgmt paths comes in follow-up PRs so the change set per PR stays small. IsManagedState treats the variable as a boolean (true/false, 1/0, yes/no, on/off, case-insensitive) and defaults to false when unset, so the historical filesystem-based behavior is unchanged. Co-authored-by: Isaac
Collaborator
|
Commit: 5d3f280 |
Adds bundle.deployment.managed_state (*bool) so users can opt into the deployment metadata service from databricks.yml as well as via the DATABRICKS_BUNDLE_MANAGED_STATE environment variable. A new ApplyManagedStateEnv mutator (registered in DefaultMutators after EntryPoint) bridges the env var into the config field; configuration takes priority over the environment variable, matching the precedent set by bundle.engine / DATABRICKS_BUNDLE_ENGINE. After DefaultMutators runs, b.Config.Bundle.Deployment.ManagedState is the single source of truth for all downstream consumers. Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
Follow the same simple-string pattern as DATABRICKS_BUNDLE_ENGINE: only the exact value "true" enables managed state, any other value is ignored. Removes the TestApplyManagedStateEnvConfigPath test which only verified struct field assignment. Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
No mutator is needed — DATABRICKS_BUNDLE_ENGINE uses the same config+env combination but resolves on demand via ResolveEngineSetting rather than writing into the config tree. Managed state will follow the same pattern: the first consumer PR adds an IsManagedState(ctx, b) resolver. This PR establishes only the config field and the env var constant. Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
Mirrors the IsDirect() pattern from the engine: a single function that checks bundle.deployment.managed_state first and falls back to the DATABRICKS_BUNDLE_MANAGED_STATE env var. Lives in the bundle package, which already imports both bundle/env and bundle/config. Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
Remove references to "historical filesystem-based behavior" and trim comment wording. Add TestIsManagedStateConfigTrue to cover the config-field=true path. Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
3 tasks
Adds engine: direct_with_history as a new enum value for bundle.engine. It is a superset of direct — IsDirect() returns true for both — and opts the bundle into the deployment metadata service (DMS) for deployment history tracking. The existing DATABRICKS_BUNDLE_ENGINE env var is the single control point; no separate field or env var is needed. IsManagedState(ctx, b) is the internal API for checking whether DMS is active. It checks bundle.engine first and falls back to the env var, matching the precedent set by ResolveEngineSetting. Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
Leftover from removing the managed_state field; the file now matches main. Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
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.
Adds
engine: direct_with_historyas a new enum value forbundle.engine. It is a superset ofdirect—IsDirect()returns true for both — and opts the bundle into the deployment metadata service (DMS) for deployment history and change tracking.Or via the existing env var:
bundle.IsDirectWithHistory(ctx, b)is the internal API for checking whether DMS history is active. It checksbundle.enginefirst and falls back to the env var, matching the precedent set byResolveEngineSetting.This is a foundation PR with no consumers yet — lock impl, state read, and operation reporting follow separately.