Skip to content

Commit e737c98

Browse files
authored
Default to direct deployment engine for new deployments (#5468)
## Summary The direct deployment engine is now **Generally Available**. This switches the default engine for *new* deployments from `terraform` to `direct`. Existing deployments are unaffected: the engine is read from recorded state, and the new default only applies when there is no state and no explicit engine set (neither `bundle.engine` config nor `DATABRICKS_BUNDLE_ENGINE`). To opt out of the direct engine, set `engine: terraform` under `bundle` in `databricks.yml`, or set `DATABRICKS_BUNDLE_ENGINE=terraform`. ## Changes - `bundle/config/engine/engine.go`: `Default` changed from `EngineTerraform` to `EngineDirect`. - `docs/direct.md`: status updated from Public Preview to Generally Available (GA). - `NEXT_CHANGELOG.md`: added a Notable Changes entry with the opt-out path and a link to the migration docs. - `acceptance/bundle/state/engine_default/`: new acceptance test that deploys with the engine unset and no existing state, asserting the direct engine is used (via the request User-Agent). ## Testing - Unit tests for `bundle/config/...`, `bundle/statemgmt/...`, `bundle/phases/...`, `cmd/bundle/...` pass. - New acceptance test passes on both engine matrix variants. This pull request and its description were written by Isaac.
1 parent 9e7d7d7 commit e737c98

11 files changed

Lines changed: 45 additions & 7 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ go.work.sum
7373
.codegen/openapi.json
7474

7575
.claude/settings.local.json
76+
.claude/scheduled_tasks.lock
7677
.cursor/cli.json
7778
tools/gofumpt
7879
.claude/worktrees/

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Release v1.3.0
44

55
### Notable Changes
6+
* The `direct` deployment engine is now Generally Available and the default for new deployments. To opt out, set `engine: terraform` under `bundle` in your `databricks.yml` or set `DATABRICKS_BUNDLE_ENGINE=terraform`. Existing deployments keep their current engine; see https://docs.databricks.com/aws/en/dev-tools/bundles/direct to migrate.
67

78
### CLI
89
* Added the `databricks quickstart` command, a short introduction to the CLI that prints a human-friendly guide interactively and an agent-oriented version when run non-interactively ([#5464](https://github.com/databricks/cli/pull/5464)).

acceptance/bundle/migrate/basic/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Updating deployment state...
117117
Deployment complete!
118118

119119
=== Different target, still on terraform
120-
>>> DATABRICKS_BUNDLE_ENGINE= [CLI] bundle deploy -t prod
120+
>>> DATABRICKS_BUNDLE_ENGINE=terraform [CLI] bundle deploy -t prod
121121
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/migrate-basic-test/prod/files...
122122
Deploying resources...
123123
Updating deployment state...

acceptance/bundle/migrate/basic/script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ trace DATABRICKS_BUNDLE_ENGINE= $CLI bundle plan -o json > out.plan_update.json
4747
trace DATABRICKS_BUNDLE_ENGINE= $CLI bundle deploy
4848

4949
title "Different target, still on terraform"
50-
trace DATABRICKS_BUNDLE_ENGINE= $CLI bundle deploy -t prod
50+
trace DATABRICKS_BUNDLE_ENGINE=terraform $CLI bundle deploy -t prod
5151
trace DATABRICKS_BUNDLE_ENGINE= $CLI bundle debug states -t prod
5252
trace DATABRICKS_BUNDLE_ENGINE= $CLI bundle debug states -t prod --force-pull
5353

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
bundle:
2+
name: test-engine-default
3+
4+
resources:
5+
schemas:
6+
foo:
7+
catalog_name: bar
8+
name: foo

acceptance/bundle/state/engine_default/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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
=== No engine configured and no state: deploy defaults to the direct engine
3+
4+
>>> [CLI] bundle deploy
5+
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-engine-default/default/files...
6+
Deploying resources...
7+
Updating deployment state...
8+
Deployment complete!
9+
10+
>>> print_requests.py //api/2.1/unity-catalog/schemas
11+
"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/bundle_deploy cmd-exec-id/[UUID] interactive/none engine/direct auth/pat"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
title 'No engine configured and no state: deploy defaults to the direct engine\n'
2+
unset DATABRICKS_BUNDLE_ENGINE
3+
trace $CLI bundle deploy
4+
trace print_requests.py //api/2.1/unity-catalog/schemas | jq '.headers["User-Agent"][0]' | contains.py 'engine/direct' '!terraform' '!tf-provider'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
RecordRequests = true
2+
IncludeRequestHeaders = ["User-Agent"]
3+
Ignore = [".databricks"]
4+
5+
# Run once (not per-engine); the script unsets DATABRICKS_BUNDLE_ENGINE to
6+
# exercise the default. "direct" (rather than []) keeps the test in the
7+
# engine-filtered CI runs.
8+
EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"]

bundle/config/engine/engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const (
1818
)
1919

2020
// Default is used for new bundles if user has not set the value
21-
const Default = EngineTerraform
21+
const Default = EngineDirect
2222

2323
// Parse returns EngineType from string
2424
func Parse(engine string) (EngineType, bool) {

0 commit comments

Comments
 (0)