Skip to content

bundle: add --deploy-apps to push source code during bundle deploy#5055

Open
jamesbroadhead wants to merge 2 commits intodatabricks:mainfrom
jamesbroadhead:jb/deploy-01-bundle-deploy-apps
Open

bundle: add --deploy-apps to push source code during bundle deploy#5055
jamesbroadhead wants to merge 2 commits intodatabricks:mainfrom
jamesbroadhead:jb/deploy-01-bundle-deploy-apps

Conversation

@jamesbroadhead
Copy link
Copy Markdown

@jamesbroadhead jamesbroadhead commented Apr 21, 2026

Summary

Addresses the DEPLOY-01 "bundle deploy does not actually deploy apps" gap surfaced in the internal EMEA Apps gaps doc (number 1 developer complaint from — the first-five-minutes experience).

Today bundle deploy only reconciles resources via the terraform/direct engine; the app source code is pushed by a separate bundle run <app> step. Users routinely miss step 2 and conclude the platform is broken when their "deployed" app does nothing new.

With --deploy-apps, the Deploy phase calls w.Apps.Deploy() for every app in the bundle after the resource CRUD completes. The flag defaults to false to preserve existing behavior for users and CI pipelines that rely on the two-step flow; once the flag proves out in the field we can flip the default.

Changes

  • bundle/appdeploy/config.go — factor the ${resources.*} reference resolution out of appRunner.resolvedConfig() into a package-level ResolveAppConfig. Takes *config.Root (not *bundle.Bundle) to avoid the bundle → direct → dresources → appdeploy import cycle.
  • bundle/phases/deploy_apps.go — new DeployApps phase. Iterates b.Config.Resources.Apps, resolves config, calls appdeploy.Deploy per app. Accumulates per-app errors via errors.Join so one failed app does not mask the others.
  • bundle/phases/deploy.go — call DeployApps at the end of the deploy phase (after the core mutator, before ScriptPostDeploy), gated on b.DeployApps.
  • bundle/bundle.go — new DeployApps bool alongside AutoApprove.
  • cmd/bundle/deploy.go — wire the --deploy-apps flag through ProcessOptions.InitFunc.
  • bundle/run/app.go — replace the in-line resolvedConfig method with a call to the new package-level helper so both code paths share the same resolution behavior.
  • bundle/appdeploy/config_test.go — unit coverage for the nil / no-config cases.

Test plan

  • go build ./... passes (including the no-import-cycle check that initially flagged my first draft)
  • go test ./bundle/appdeploy/... ./bundle/phases/... ./bundle/run/... ./cmd/bundle/... passes
  • make fmt clean
  • Integration test that deploys a bundle with an app and asserts source ends up at the workspace path (follow-up)
  • Acceptance test with a fixture bundle containing an apps: resource (follow-up)

Follow-ups explicitly out of scope

  • Default flip: tie to a release where the behavior is documented as the new expectation.
  • A deeper dyn.Value-driven unit test for ResolveAppConfig (requires setting up a populated config.Root via the standard bundle load path).
  • Error-reporting shape when an app's compute is not yet running — the existing appdeploy.Deploy retries on in-progress deployments; there may be additional pre-conditions worth surfacing here.

This pull request and its description were written by Claude (claude.ai).

Addresses the DEPLOY-01 "bundle deploy does not actually deploy apps" gap. Today
`bundle deploy` reconciles resources via terraform/direct, but the app source
code is pushed by a separate `bundle run <app>` step that users routinely miss
— they run the documented deploy command, see their app unchanged, and
conclude the platform is broken.

With `--deploy-apps`, the Deploy phase calls `w.Apps.Deploy()` for every app in
the bundle after the resource CRUD path completes. The flag defaults to false
to preserve existing behavior for users and CI pipelines relying on the
two-step flow; once the flag proves out in the field we can flip the default.

Changes
-------

* bundle/appdeploy/config.go: factor the ${resources.*} reference resolution out
  of appRunner.resolvedConfig() into a package-level ResolveAppConfig. Takes
  *config.Root (not *bundle.Bundle) to avoid the bundle -> direct ->
  dresources -> appdeploy import cycle.
* bundle/phases/deploy_apps.go: new DeployApps phase. Iterates b.Config.Resources.Apps,
  resolves config, calls appdeploy.Deploy per app. Accumulates per-app errors
  via errors.Join so one failed app does not mask the others.
* bundle/phases/deploy.go: call DeployApps at the end of the deploy phase (after
  the core mutator, before ScriptPostDeploy), gated on b.DeployApps.
* bundle/bundle.go: new DeployApps bool alongside AutoApprove.
* cmd/bundle/deploy.go: wire the --deploy-apps flag through ProcessOptions.InitFunc.
* bundle/run/app.go: replace the in-line resolvedConfig method with a call to
  the new package-level helper so both code paths share the same resolution
  behavior.
* bundle/appdeploy/config_test.go: unit coverage for the nil / no-config cases.
  A ${resources.*} interpolation test is deferred to follow-up (needs a
  populated config.Root via the standard bundle load path).

Follow-ups
----------

* Integration test that deploys a bundle with an app and asserts the source
  code ends up at the workspace path.
* Decide default flip (likely tied to a v0.N release where the behavior is
  documented as the new expectation).
* A deeper dyn.Value-driven unit test for ResolveAppConfig to cover interpolation.

Co-authored-by: Isaac
If the bundle has `apps:` resources but the user did not pass
`--deploy-apps`, the resource phase succeeds and apps appear "deployed"
— yet their source code was never pushed. This is the exact first-five-
minutes confusion the flag was introduced to fix; silent skipping made
the original problem slightly worse for anyone who didn't read the
release notes.

Print a line per app pointing at `databricks bundle run <app>`, which
remains the current way to push source after a `bundle deploy`.

Co-authored-by: Isaac
@github-actions
Copy link
Copy Markdown

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 5055
  • Commit SHA: c83e95dd2fc37be08ade51fe17b64632c97168be

Checks will be approved automatically on success.

@jamesbroadhead jamesbroadhead marked this pull request as ready for review April 21, 2026 17:20
@github-actions
Copy link
Copy Markdown

Approval status: pending

/bundle/ - needs approval

7 files changed
Suggested: @denik
Also eligible: @andrewnester, @shreyas-goenka, @pietern, @lennartkats-db, @anton-107, @janniklasrose

/cmd/bundle/ - needs approval

Files: cmd/bundle/deploy.go
Suggested: @denik
Also eligible: @andrewnester, @shreyas-goenka, @pietern, @lennartkats-db, @anton-107, @janniklasrose

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db) can approve all areas.
See OWNERS for ownership rules.

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.

1 participant