Skip to content

bundle: add direct_with_history engine type#5365

Draft
shreyas-goenka wants to merge 10 commits into
mainfrom
shreyas-goenka/cli-managed-state-flag
Draft

bundle: add direct_with_history engine type#5365
shreyas-goenka wants to merge 10 commits into
mainfrom
shreyas-goenka/cli-managed-state-flag

Conversation

@shreyas-goenka
Copy link
Copy Markdown
Contributor

@shreyas-goenka shreyas-goenka commented May 28, 2026

Adds engine: direct_with_history as a new enum value for bundle.engine. It is a superset of directIsDirect() returns true for both — and opts the bundle into the deployment metadata service (DMS) for deployment history and change tracking.

# databricks.yml
bundle:
  engine: direct_with_history

Or via the existing env var:

DATABRICKS_BUNDLE_ENGINE=direct_with_history databricks bundle deploy

bundle.IsDirectWithHistory(ctx, b) is the internal API for checking whether DMS history is active. It checks bundle.engine first and falls back to the env var, matching the precedent set by ResolveEngineSetting.

This is a foundation PR with no consumers yet — lock impl, state read, and operation reporting follow separately.

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
@eng-dev-ecosystem-bot
Copy link
Copy Markdown
Collaborator

eng-dev-ecosystem-bot commented May 28, 2026

Commit: 5d3f280

Run: 26753667754

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>
@shreyas-goenka shreyas-goenka changed the title bundle/env: add DATABRICKS_BUNDLE_MANAGED_STATE flag helper bundle: add managed_state deployment config field and env var support May 31, 2026
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>
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>
@shreyas-goenka shreyas-goenka changed the title bundle: add managed_state deployment config field and env var support bundle: add direct_with_history engine type Jun 1, 2026
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>
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.

2 participants