Skip to content

Added support for --bind flag in bundle generate - #3782

Merged
andrewnester merged 14 commits into
mainfrom
feat/auto-bind
Oct 28, 2025
Merged

Added support for --bind flag in bundle generate#3782
andrewnester merged 14 commits into
mainfrom
feat/auto-bind

Conversation

@andrewnester

Copy link
Copy Markdown
Contributor

Changes

Added support for --bind flag in bundle generate

Why

This allows us to generate and bind the resources using one command instead of 2 separate commands.

Tests

Added an acceptance test

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Oct 17, 2025

Copy link
Copy Markdown
Collaborator

Run: 18873802576

Env❌​FAIL🟨​KNOWN🔄​flaky💚​RECOVERED🙈​SKIP✅​pass🙈​skip
💚​aws linux12320582
💚​aws windows12321581
💚​aws-ucws linux21440478
💚​aws-ucws windows21441477
💚​azure linux12320581
💚​azure windows12321580
🟨​azure-ucws linux21438477
🟨​azure-ucws windows221437476
❌​gcp linux5812265571
❌​gcp windows2212302578
73 failing tests:
Test Nameaws linuxaws windowsaws-ucws linuxaws-ucws windowsazure linuxazure windowsazure-ucws linuxazure-ucws windowsgcp linuxgcp windows
TestAccept💚​R💚​R💚​R💚​R💚​R💚​R🟨​K🟨​K🟨​K🟨​K
TestAccept/bundle/deploy/files/no-snapshot-sync✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/deploy/files/no-snapshot-sync/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/destroy/jobs-and-pipeline✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/resources/jobs/check-metadata✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F❌​F
TestAccept/bundle/resources/jobs/check-metadata/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F❌​F
TestAccept/bundle/resources/jobs/double-underscore-keys✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/resources/jobs/double-underscore-keys/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/resources/jobs/fail-on-active-runs✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/resources/jobs/fail-on-active-runs/DATABRICKS_BUNDLE_ENGINE=direct-exp✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/resources/models/basic✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/resources/models/basic/DATABRICKS_BUNDLE_ENGINE=direct-exp✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/resources/pipelines/update✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F
TestAccept/bundle/resources/pipelines/update/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F
TestAccept/bundle/resources/synced_database_tables/basic🙈​S🙈​S💚​R💚​R🙈​S🙈​S🟨​K🟨​K🙈​S🙈​S
TestAccept/bundle/run/app-with-job🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
TestAccept/bundle/templates/default-python/combinations/classic✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F❌​F
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=no/NBOOK=no/PY=no✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=no/NBOOK=no/PY=yes✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=no/NBOOK=yes/PY=no✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=no/NBOOK=yes/PY=yes✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=yes/NBOOK=no/PY=no✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=yes/NBOOK=no/PY=yes✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=yes/NBOOK=yes/PY=no✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F❌​F
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=yes/NBOOK=yes/PY=yes✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=no/PY=no✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F❌​F
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=no/PY=yes✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F❌​F
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=yes/PY=no✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=yes/PY=yes✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F❌​F
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=yes/PY=yes✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/templates/default-python/combinations/serverless✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F❌​F
TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=no/NBOOK=no/PY=no🙈​s🙈​s✅​p✅​p🙈​s🙈​s✅​p✅​p🙈​s❌​F
TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=no/NBOOK=no/PY=yes🙈​s🙈​s✅​p✅​p🙈​s🙈​s✅​p✅​p❌​F❌​F
TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=no/NBOOK=yes/PY=no🙈​s🙈​s✅​p✅​p🙈​s🙈​s✅​p✅​p❌​F🙈​s
TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=no/NBOOK=yes/PY=yes🙈​s🙈​s✅​p✅​p🙈​s🙈​s✅​p✅​p❌​F🙈​s
TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=yes/NBOOK=no/PY=no🙈​s🙈​s✅​p✅​p🙈​s🙈​s✅​p✅​p❌​F🙈​s
TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=yes/NBOOK=no/PY=yes🙈​s🙈​s✅​p✅​p🙈​s🙈​s✅​p✅​p❌​F🙈​s
TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=yes/NBOOK=yes/PY=no🙈​s🙈​s✅​p✅​p🙈​s🙈​s✅​p✅​p❌​F🙈​s
TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=yes/NBOOK=yes/PY=yes🙈​s🙈​s✅​p✅​p🙈​s🙈​s✅​p✅​p🙈​s❌​F
TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=no/PY=no🙈​s🙈​s✅​p✅​p🙈​s🙈​s✅​p✅​p❌​F🙈​s
TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=no/PY=yes🙈​s🙈​s✅​p✅​p🙈​s🙈​s✅​p✅​p❌​F🙈​s
TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=yes/PY=no🙈​s🙈​s✅​p✅​p🙈​s🙈​s✅​p✅​p❌​F🙈​s
TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=yes/PY=yes🙈​s🙈​s✅​p✅​p🙈​s🙈​s✅​p✅​p❌​F🙈​s
TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=no/PY=no🙈​s🙈​s✅​p✅​p🙈​s🙈​s✅​p✅​p❌​F🙈​s
TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=yes/PY=no🙈​s🙈​s✅​p✅​p🙈​s🙈​s✅​p✅​p❌​F🙈​s
TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=yes/PY=yes🙈​s🙈​s✅​p✅​p🙈​s🙈​s✅​p✅​p🙈​s❌​F
TestAccept/bundle/templates/default-python/integration_classic✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F❌​F
TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/UV_PYTHON=3.12✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F
TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/UV_PYTHON=3.13✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F
TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/UV_PYTHON=3.9✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F
TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=terraform/UV_PYTHON=3.10✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=terraform/UV_PYTHON=3.11✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F❌​F
TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=terraform/UV_PYTHON=3.12✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F
TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=terraform/UV_PYTHON=3.13✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F
TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=terraform/UV_PYTHON=3.9✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F
TestExport✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestExportWithFileFlag✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestImportDirDoesNotOverwrite✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestImportDirWithOverwriteFlag✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestImportFileFormatAuto✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestImportFileFormatSource✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestImportFileUsingContentFormatAuto✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestImportFileUsingContentFormatSource✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestFilerRecursiveDelete✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestFilerRecursiveDelete/workspace_files✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestFilerRecursiveDelete/workspace_files_extensions✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestFilerWorkspaceFilesExtensionsRead✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestFilerWorkspaceFilesExtensionsReadDir✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestFilerWorkspaceNotebook✅​p✅​p✅​p✅​p✅​p✅​p✅​p🔄​f❌​F✅​p
TestFilerWorkspaceNotebook/scalaNb.scala✅​p✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p
TestWorkspaceFilesExtensions_ExportFormatIsPreserved✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p
TestWorkspaceFilesExtensions_ExportFormatIsPreserved/source_python✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p

Comment threadacceptance/bundle/generate/auto-bind/output.txt
@@ -0,0 +1,26 @@
# This test is using a workspace import API to load a notebook file.
# This API has a logic on how to accept notebook files and distinguishes them from regular python files.
# To succeed locally we would need to replicate this logic in the fake_workspace

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth doing some time?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly, there are a bunch of other tests that need this, worth doing this as a separate PR

Comment threadacceptance/bundle/help/bundle-generate-dashboard/output.txt Outdated
Comment threadcmd/bundle/generate/app.go
Comment threadcmd/bundle/deployment/bind_resource.go Outdated
Comment threadcmd/bundle/deployment/bind_resource.go Outdated

@shreyas-goenkashreyas-goenka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to publish my review last week.

Comment on lines +26 to +33
Two-step workflow (manual bind):
1. Generate: databricks bundle generate job --existing-job-id 123 --key my_job
2. Bind: databricks bundle deployment bind my_job 123
3. Deploy: databricks bundle deploy

One-step workflow (automatic bind):
1. Generate and bind: databricks bundle generate job --existing-job-id 123 --key my_job --bind
2. Deploy: databricks bundle deploy

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
Two-stepworkflow (manualbind):
1. Generate: databricksbundlegeneratejob--existing-job-id123--keymy_job
2. Bind: databricksbundledeploymentbindmy_job123
3. Deploy: databricksbundledeploy
One-stepworkflow (automaticbind):
1.Generateand bind: databricksbundlegeneratejob--existing-job-id123--keymy_job--bind
2. Deploy: databricksbundledeploy
Three-stepworkflow (manualbind):
1. Generate: databricksbundlegeneratejob--existing-job-id123--keymy_job
2. Bind: databricksbundledeploymentbindmy_job123
3. Deploy: databricksbundledeploy
Two-stepworkflow (automaticbind):
1.Generateand bind: databricksbundlegeneratejob--existing-job-id123--keymy_job--bind
2. Deploy: databricksbundledeploy

Comment threadcmd/bundle/generate/app.go
// This function is shared between the bind command and generate commands with --bind flag.
func BindResource(cmd *cobra.Command, resourceKey, resourceId string, autoApprove, forceLock bool) error {
ctx := cmd.Context()
b := utils.ConfigureBundleWithVariables(cmd)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This means functions like root.MustConfigureBundle end up being called twice on the command struct.

}

if !exists {
return fmt.Errorf("%s with an id '%s' is not found", resource.ResourceDescription().SingularName, resourceId)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grammer nit:

Suggested change
returnfmt.Errorf("%s with an id '%s' is not found", resource.ResourceDescription().SingularName, resourceId)
returnfmt.Errorf("%s with an id '%s' was not found", resource.ResourceDescription().SingularName, resourceId)

@andrewnester
andrewnester merged commit bc10093 into mainOct 28, 2025
12 of 13 checks passed
@andrewnester
andrewnester deleted the feat/auto-bind branch October 28, 2025 13:56
deco-sdk-taggingBot added a commit that referenced this pull request Oct 29, 2025
## Release v0.275.0
### Notable Changes
* Python support for Databricks Asset Bundles is now generally available.
### CLI
* Remove `inplace` mode for the `--progress-format` flag ([#3811](#3811))
* Remove `json` mode for the `--progress-format` flag ([#3812](#3812))
* Deprecate the `--progress-format` flag ([#3819](#3819))
### Bundles
* Add support for `--bind` flag in `bundle generate` ([#3782](#3782))
* Add `pydabs` template replacing `experimental-jobs-as-code` template ([#3806](#3806))
* You can now use the top-level `python` section instead of `experimental/python` ([#3540](#3540))
denik pushed a commit that referenced this pull request May 20, 2026
## Changes
Added support for --bind flag in `bundle generate`
## Why
This allows us to generate and bind the resources using one command
instead of 2 separate commands.
## Tests
Added an acceptance test
<!-- If your PR needs to be included in the release notes for next
release,
add a separate entry in NEXT_CHANGELOG.md as part of your PR. -->
denik pushed a commit that referenced this pull request May 20, 2026
## Release v0.275.0
### Notable Changes
* Python support for Databricks Asset Bundles is now generally available.
### CLI
* Remove `inplace` mode for the `--progress-format` flag ([#3811](#3811))
* Remove `json` mode for the `--progress-format` flag ([#3812](#3812))
* Deprecate the `--progress-format` flag ([#3819](#3819))
### Bundles
* Add support for `--bind` flag in `bundle generate` ([#3782](#3782))
* Add `pydabs` template replacing `experimental-jobs-as-code` template ([#3806](#3806))
* You can now use the top-level `python` section instead of `experimental/python` ([#3540](#3540))
Sign up for freeto 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.

5 participants

@andrewnester@eng-dev-ecosystem-bot@pietern@denik@shreyas-goenka