Skip to content

Add default-bare template and bundle generate --init-bare - #7355

Closed
janniklasrose wants to merge 18 commits into
mainfrom
janniklasrose/bundle-generate-init-bare
Closed

janniklasrose wants to merge 18 commits into
mainfrom
janniklasrose/bundle-generate-init-bare

Conversation

@janniklasrose

Copy link
Copy Markdown
Member

Changes

Lets users start a bundle from an existing workspace resource without writing a databricks.yml first.

  • New built-in template default-bare: databricks.yml (one dev target), resources/, src/, .gitignore, and a short README. It renders directly into the output directory rather than a project subdirectory, so bundle init default-bare --output-dir . and the flag below both create the bundle in place.
  • New persistent flag --init-bare on bundle generate. When no bundle is found, the generate subcommand materializes default-bare in the current directory (named after it) and then generates into it. Without the flag the command now prints a hint pointing at the template and the flag instead of the raw "no databricks.yml" error.
  • Flags that only make sense against an existing bundle (--bind, dashboard and Genie space --resource / --watch) are rejected before anything is written to disk.
  • All generate subcommands share one configureBundle helper in cmd/bundle/generate/init_bare.go, which sets up diagnostics and loads the bundle once. root.MustWorkspaceClient now skips logdiag.InitContext when a caller has already set it up; the bare path needs it from inside RunE so the template can render workspace_host.
  • cmd/bundle/generate_test.go checks every resource group in config.SupportedResources() either has a generate subcommand or is listed as unsupported, so new resource types get an explicit decision.

Why a new template instead of default-minimal

default-minimal (alias empty) still renders from the shared default tree: with language skip it produces .vscode/, AGENTS.md, fixtures/, and a README aimed at project development. For importing existing resources that is noise, and the shared template keeps growing. default-bare is five files and is the only template a generate subcommand needs to know about.

Follow-ups (not in this PR)

  • Generate subcommands for the remaining resource groups (UC core, ML and serving, compute and SQL, secrets, Lakebase). generateUnsupported in the parity test is the to-do list.
  • Deduplicating the per-subcommand scaffolding (key derivation, file naming, saver, bind) once more subcommands exist.

Why

bundle generate was only usable from inside an existing bundle, and none of the init templates produced a skeleton small enough to be a sensible starting point for importing resources.

Tests

  • acceptance/bundle/generate/job_init_bare: happy path, bundle named after the directory plus the generated job and notebook.
  • acceptance/bundle/generate/init_bare_rejected_flags: hint without the flag; --bind, --resource, and --watch rejected with no files written.
  • acceptance/bundle/templates/default-bare/minimal: bundle init default-bare followed by bundle validate.
  • Help goldens for bundle generate, its subcommands, and bundle init regenerated.
  • go test ./cmd/bundle/... ./libs/template/ and the bundle/generate, bundle/templates/default-bare, bundle/help acceptance suites pass locally.

This pull request and its description were written by Isaac.

janniklasrose and others added 16 commits October 15, 2026 07:37
Introduce a minimal built-in bundle template designed for zero-to-import workflows,
containing only the essential directory structure (resources/, src/, .gitignore,
databricks.yml, README). Register it as 'default-bare' alongside other templates
and surface it in bundle init help text. Refactor init.go flag handling to use
GetString() and extract Resolver construction into a helper function.

Co-authored-by: Isaac <no-reply@databricks.com>
Add an explicit --init-bare flag to 'bundle generate' that automatically
initializes a bare bundle skeleton when one doesn't exist. Create shared
generate plumbing (ensureGenerateBundle, initializeBareBundle) that handles
the choice between bundle-aware and auth-only modes. Update job generator
to use the new helper. When --init-bare is used without an existing bundle,
materialize the default-bare template with a derived project name before
proceeding with generation.

Co-authored-by: Isaac <no-reply@databricks.com>
Create a parity test that documents which bundle resource types have
generate support implemented and which ones don't. This serves as a
checklist and commit point: new resource types added to bundle/config/resources.go
should either get generate support or be explicitly listed as unsupported.
Currently supported: job, pipeline, dashboard, alert, app, genie_space.

Co-authored-by: Isaac <no-reply@databricks.com>
Regenerate bundle generate help output to include --init-bare flag documentation.
Add acceptance test for the new default-bare template that verifies the template
materializes correctly with proper directory structure for resources and src.

Co-authored-by: Isaac <no-reply@databricks.com>
Document the new --init-bare flag for bundle generate in the changelog.

Co-authored-by: Isaac <no-reply@databricks.com>
Update test expectations in template_test.go to reflect the new
default-bare template addition. Include it in help descriptions,
options, and template availability checks.

Co-authored-by: Isaac <no-reply@databricks.com>
Make parity_test.go real by enumerating all bundle resource types and
validating that each is either supported with a generate command or in an
explicit unsupported allowlist. This catches when new resources are added
without corresponding generator support.

Wire --init-bare into all generate commands (job, pipeline, alert, app)
by using ensureGenerateBundle helper. Add flag validation to reject
incompatible combinations with --init-bare before materialization:
- --bind (no deployment state without existing bundle)
- dashboard --resource (requires existing bundle resources)
- dashboard --watch (requires existing bundle resources to watch)

Co-authored-by: Isaac <no-reply@databricks.com>
Update help snapshots to include --init-bare flag documentation and
updated descriptions for all bundle generate subcommands (job, pipeline,
dashboard, app, alert) and bundle init command.

Co-authored-by: Isaac <no-reply@databricks.com>
…tion tests

- Add ensureGenerateBundle to dashboard and genie_space generators to enable
  --init-bare flag and properly validate incompatible flag combinations
- Add PersistentPreRunE to generate command to initialize workspace client
  before running subcommands (required for template materialization)
- Fix InitContext duplicate initialization in job.go
- Add acceptance test for --init-bare --bind rejection (negative case)
  that verifies error is thrown before any bundle materialization
- All generators now support --init-bare for bare bundle initialization

Co-authored-by: Isaac <no-reply@databricks.com>
The PersistentPreRunE for bundle generate command was not being set properly,
causing cmdio to be missing from the context when generate subcommands tried to
use it for logging diagnostics. This led to panics when downloader.FlushToDisk
tried to call cmdio.LogString.

The fix:
- Removed PersistentPreRunE from bundle generate command to avoid overriding
  root's initialization
- Added ensureWorkspaceClient function that is called from each generate
  subcommand's RunE to initialize workspace client when needed
- Modified root.MustWorkspaceClient to check if logdiag is already initialized
  before calling logdiag.InitContext to avoid double-initialization panic

This ensures both cmdio (from root's PersistentPreRunE) and workspace client
are properly initialized in the context for template materialization.

Co-authored-by: Isaac <no-reply@databricks.com>
Records the plan for the bare template, --init-bare and the resource families, plus this branch's status and open issues.

Co-authored-by: Isaac <no-reply@databricks.com>
# Conflicts:
#	acceptance/bundle/help/bundle-init/output.txt
#	cmd/bundle/init.go
…up front

Every generate subcommand now goes through configureBundle, which sets up
logdiag, loads the bundle, and only when none exists and --init-bare is set
materializes the default-bare template and loads that. Flags that need an
existing bundle (--bind, --resource, --watch) are rejected before anything
is written to disk.

This replaces the earlier helper that initialized logdiag and loaded the
bundle up to three times per invocation. MustWorkspaceClient skips
logdiag.InitContext when a caller has already set it up, since the bare
path calls it from inside RunE for template helpers like workspace_host.

Co-authored-by: Isaac <no-reply@databricks.com>
The template no longer nests its files under a project directory, so
`bundle init default-bare --output-dir .` and `bundle generate --init-bare`
both produce a bundle right where the user is. The bundle is still named by
the project_name input, which --init-bare derives from the directory name.

Also uses the Declarative Automation Bundle wording that main adopted for
the other templates.

Co-authored-by: Isaac <no-reply@databricks.com>
The previous test compared two hand-written maps, so a new resource type
could never fail it. It now reads the generate subcommands from the command
tree and the resource groups from config.SupportedResources, and fails when
a group is neither generated nor explicitly listed as unsupported.

Co-authored-by: Isaac <no-reply@databricks.com>
job_init_bare covers the happy path: a bare bundle named after the directory
plus the generated job. init_bare_rejected_flags covers the hint printed
without --init-bare and the rejection of --bind, --resource and --watch
before anything is written.

Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions github-actions Bot added the DABs DABs related issues label Nov 4, 2026
janniklasrose and others added 2 commits November 4, 2026 15:50
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Commit: 7507ca647 | Workflow run

Regression test report

Selected 8 changed tests (limit=20, 0 not selected)

15 tests: regression=15 unreleased=0 coverage=0 failing=0
test branch main (e1b8c92) latest (v1.24.0)
TestAccept/bundle/generate/init_bare_rejected_flags/DMS= ✅ ❌ ❌
TestAccept/bundle/generate/init_bare_rejected_flags/DMS=true ✅ ❌ ❌
TestAccept/bundle/generate/job_init_bare/DMS= ✅ ❌ ❌
TestAccept/bundle/generate/job_init_bare/DMS=true ✅ ❌ ❌
TestAccept/bundle/help/bundle-generate-dashboard/DMS= ✅ ❌ ❌
TestAccept/bundle/help/bundle-generate-dashboard/DMS=true ✅ ❌ ❌
TestAccept/bundle/help/bundle-generate-job/DMS= ✅ ❌ ❌
TestAccept/bundle/help/bundle-generate-job/DMS=true ✅ ❌ ❌
TestAccept/bundle/help/bundle-generate-pipeline/DMS= ✅ ❌ ❌
TestAccept/bundle/help/bundle-generate-pipeline/DMS=true ✅ ❌ ❌
TestAccept/bundle/help/bundle-generate/DMS= ✅ ❌ ❌
TestAccept/bundle/help/bundle-generate/DMS=true ✅ ❌ ❌
TestAccept/bundle/help/bundle-init/DMS= ✅ ❌ ❌
TestAccept/bundle/help/bundle-init/DMS=true ✅ ❌ ❌
TestAccept/bundle/templates/default-bare/minimal/DMS= ✅ ❌ ❌
TestAccept/bundle/generate/init_bare_rejected_flags/DMS=: branch ✅ | main (e1b8c92) ❌ | latest (v1.24.0) ❌

main (e1b8c92):

acceptance_test.go:1342: Diff:
        --- bundle/generate/init_bare_rejected_flags/output.txt
        +++ /tmp/TestAcceptbundlegenerateinit_bare_rejected_flagsDMS=3257662471/002/output.txt
        @@ -1,22 +1,89 @@
         
         >>> errcode [CLI] bundle generate job --existing-job-id 1234
        -Error: no databricks.yml found in this directory or any parent; run `databricks bundle init default-bare` first or re-run with --init-bare
        +Error: Unable to locate the bundle root: databricks.yml not found.
         
        +Run this command from a directory that contains a bundle, or set the DATABRICKS_BUNDLE_ROOT environment variable to the bundle root directory.
        +Alternatively, create a new bundle with 'databricks bundle init'.
        +
        +
         Exit code: 1
         
         >>> errcode [CLI] bundle generate job --existing-job-id 1234 --init-bare --bind
        -Error: --bind requires an existing bundle and cannot be combined with --init-bare
        +Error: unknown flag: --init-bare
         
        +Usage:
        +  databricks bundle generate job [flags]
        +
        +Flags:
        +  -d, --config-dir string             Dir path where the output config will be stored (default "resources")
        +      --download-spark-python-files   download workspace files referenced by spark_python_task and rewrite them to a relative path
        +      --existing-job-id int           Job ID of the job to generate config for
        +  -f, --force                         Force overwrite existing files in the output directory
        +  -h, --help                          help for job
        +  -s, --source-dir string             Dir path where the downloaded files will be stored (default "src")
        +
        +Global Flags:
        +      --debug            enable debug logging
        +      --key string       resource key to use for the generated configuration
        +  -o, --output type      output type: text or json (default text)
        +  -p, --profile string   ~/.databrickscfg profile
        +  -t, --target string    bundle target to use (if applicable)
        +      --var strings      set values for variables defined in bundle config. Example: --var="foo=bar"
        +
        +
         Exit code: 1
         
         >>> errcode [CLI] bundle generate dashboard --resource my_dashboard --init-bare
        -Error: --resource requires an existing bundle and cannot be combined with --init-bare
        +Error: unknown flag: --init-bare
         
        +Usage:
        +  databricks bundle generate dashboard [flags]
        +
        +Flags:
        +  -s, --dashboard-dir string   directory to write the dashboard representation to (default "src")
        +      --existing-id string     ID of the dashboard to generate configuration for
        +      --existing-path string   workspace path of the dashboard to generate configuration for
        +  -f, --force                  force overwrite existing files in the output directory
        +  -h, --help                   help for dashboard
        +      --resource string        resource key of dashboard to watch for changes
        +  -d, --resource-dir string    directory to write the configuration to (default "resources")
        +      --watch                  watch for changes to the dashboard and update the configuration
        +
        +Global Flags:
        +      --debug            enable debug logging
        +      --key string       resource key to use for the generated configuration
        +  -o, --output type      output type: text or json (default text)
        +  -p, --profile string   ~/.databrickscfg profile
        +  -t, --target string    bundle target to use (if applicable)
        +      --var strings      set values for variables defined in bundle config. Example: --var="foo=bar"
        +
        +
         Exit code: 1
         
         >>> errcode [CLI] bundle generate genie-space --resource my_space --watch --init-bare
        -Error: --resource requires an existing bundle and cannot be combined with --init-bare
        +Error: unknown flag: --init-bare
         
        +Usage:
        +  databricks bundle generate genie-space [flags]
        +
        +Flags:
        +      --existing-id string       ID of the Genie space to generate configuration for
        +  -f, --force                    force overwrite existing files in the output directory
        +  -s, --genie-space-dir string   directory to write the Genie space representation to (default "src")
        +  -h, --help                     help for genie-space
        +      --resource string          resource key of Genie space to watch for changes
        +  -d, --resource-dir string      directory to write the configuration to (default "resources")
        +      --watch                    watch for changes to the Genie space and update the configuration
        +
        +Global Flags:
        +      --debug            enable debug logging
        +      --key string       resource key to use for the generated configuration
        +  -o, --output type      output type: text or json (default text)
        +  -p, --profile string   ~/.databrickscfg profile
        +  -t, --target string    bundle target to use (if applicable)
        +      --var strings      set values for variables defined in bundle config. Example: --var="foo=bar"
        +
        +
         Exit code: 1
         
         >>> find.py databricks.yml --expect 0

latest (v1.24.0): same output as main (e1b8c92)

TestAccept/bundle/generate/init_bare_rejected_flags/DMS=true: branch ✅ | main (e1b8c92) ❌ | latest (v1.24.0) ❌

main (e1b8c92):

acceptance_test.go:1342: Diff:
        --- bundle/generate/init_bare_rejected_flags/output.txt
        +++ /tmp/TestAcceptbundlegenerateinit_bare_rejected_flagsDMS=true631995843/002/output.txt
        @@ -1,22 +1,89 @@
         
         >>> errcode [CLI] bundle generate job --existing-job-id 1234
        -Error: no databricks.yml found in this directory or any parent; run `databricks bundle init default-bare` first or re-run with --init-bare
        +Error: Unable to locate the bundle root: databricks.yml not found.
         
        +Run this command from a directory that contains a bundle, or set the DATABRICKS_BUNDLE_ROOT environment variable to the bundle root directory.
        +Alternatively, create a new bundle with 'databricks bundle init'.
        +
        +
         Exit code: 1
         
         >>> errcode [CLI] bundle generate job --existing-job-id 1234 --init-bare --bind
        -Error: --bind requires an existing bundle and cannot be combined with --init-bare
        +Error: unknown flag: --init-bare
         
        +Usage:
        +  databricks bundle generate job [flags]
        +
        +Flags:
        +  -d, --config-dir string             Dir path where the output config will be stored (default "resources")
        +      --download-spark-python-files   download workspace files referenced by spark_python_task and rewrite them to a relative path
        +      --existing-job-id int           Job ID of the job to generate config for
        +  -f, --force                         Force overwrite existing files in the output directory
        +  -h, --help                          help for job
        +  -s, --source-dir string             Dir path where the downloaded files will be stored (default "src")
        +
        +Global Flags:
        +      --debug            enable debug logging
        +      --key string       resource key to use for the generated configuration
        +  -o, --output type      output type: text or json (default text)
        +  -p, --profile string   ~/.databrickscfg profile
        +  -t, --target string    bundle target to use (if applicable)
        +      --var strings      set values for variables defined in bundle config. Example: --var="foo=bar"
        +
        +
         Exit code: 1
         
         >>> errcode [CLI] bundle generate dashboard --resource my_dashboard --init-bare
        -Error: --resource requires an existing bundle and cannot be combined with --init-bare
        +Error: unknown flag: --init-bare
         
        +Usage:
        +  databricks bundle generate dashboard [flags]
        +
        +Flags:
        +  -s, --dashboard-dir string   directory to write the dashboard representation to (default "src")
        +      --existing-id string     ID of the dashboard to generate configuration for
        +      --existing-path string   workspace path of the dashboard to generate configuration for
        +  -f, --force                  force overwrite existing files in the output directory
        +  -h, --help                   help for dashboard
        +      --resource string        resource key of dashboard to watch for changes
        +  -d, --resource-dir string    directory to write the configuration to (default "resources")
        +      --watch                  watch for changes to the dashboard and update the configuration
        +
        +Global Flags:
        +      --debug            enable debug logging
        +      --key string       resource key to use for the generated configuration
        +  -o, --output type      output type: text or json (default text)
        +  -p, --profile string   ~/.databrickscfg profile
        +  -t, --target string    bundle target to use (if applicable)
        +      --var strings      set values for variables defined in bundle config. Example: --var="foo=bar"
        +
        +
         Exit code: 1
         
         >>> errcode [CLI] bundle generate genie-space --resource my_space --watch --init-bare
        -Error: --resource requires an existing bundle and cannot be combined with --init-bare
        +Error: unknown flag: --init-bare
         
        +Usage:
        +  databricks bundle generate genie-space [flags]
        +
        +Flags:
        +      --existing-id string       ID of the Genie space to generate configuration for
        +  -f, --force                    force overwrite existing files in the output directory
        +  -s, --genie-space-dir string   directory to write the Genie space representation to (default "src")
        +  -h, --help                     help for genie-space
        +      --resource string          resource key of Genie space to watch for changes
        +  -d, --resource-dir string      directory to write the configuration to (default "resources")
        +      --watch                    watch for changes to the Genie space and update the configuration
        +
        +Global Flags:
        +      --debug            enable debug logging
        +      --key string       resource key to use for the generated configuration
        +  -o, --output type      output type: text or json (default text)
        +  -p, --profile string   ~/.databrickscfg profile
        +  -t, --target string    bundle target to use (if applicable)
        +      --var strings      set values for variables defined in bundle config. Example: --var="foo=bar"
        +
        +
         Exit code: 1
         
         >>> find.py databricks.yml --expect 0

latest (v1.24.0): same output as main (e1b8c92)

TestAccept/bundle/generate/job_init_bare/DMS=: branch ✅ | main (e1b8c92) ❌ | latest (v1.24.0) ❌

main (e1b8c92):

acceptance_test.go:1342: Diff:
        --- bundle/generate/job_init_bare/output.txt
        +++ /tmp/TestAcceptbundlegeneratejob_init_bareDMS=3924396640/002/output.txt
        @@ -1,47 +1,25 @@
         
         >>> [CLI] bundle generate job --existing-job-id 1234 --key out --init-bare
        -No databricks.yml found. Initializing a bare bundle skeleton.
        -Welcome to the bare Declarative Automation Bundle template!
        +Error: unknown flag: --init-bare
         
        -This template creates the smallest bundle skeleton, meant for importing existing resources with `databricks bundle generate`.
        +Usage:
        +  databricks bundle generate job [flags]
         
        -Your workspace at [DATABRICKS_URL] is used for initialization.
        +Flags:
        +  -d, --config-dir string             Dir path where the output config will be stored (default "resources")
        +      --download-spark-python-files   download workspace files referenced by spark_python_task and rewrite them to a relative path
        +      --existing-job-id int           Job ID of the job to generate config for
        +  -f, --force                         Force overwrite existing files in the output directory
        +  -h, --help                          help for job
        +  -s, --source-dir string             Dir path where the downloaded files will be stored (default "src")
         
        -✨ Your bare bundle has been created.
        +Global Flags:
        +      --debug            enable debug logging
        +      --key string       resource key to use for the generated configuration
        +  -o, --output type      output type: text or json (default text)
        +  -p, --profile string   ~/.databrickscfg profile
        +  -t, --target string    bundle target to use (if applicable)
        +      --var strings      set values for variables defined in bundle config. Example: --var="foo=bar"
         
        -Add generated resources under `resources/` and supporting code under `src/`.
        -File successfully saved to src/outnotebook.py
        -Job configuration successfully saved to resources/out.job.yml
         
        ->>> find.py ^(resources|src)/
        -resources/.gitkeep
        -resources/out.job.yml
        -src/.gitkeep
        -src/outnotebook.py
        -
        ->>> cat databricks.yml
        -# This is a Declarative Automation Bundle definition for my_project.
        -# See https://docs.databricks.com/dev-tools/bundles/index.html for documentation.
        -bundle:
        -  name: my_project
        -  uuid: [UUID]
        -
        -include:
        -  - resources/*.yml
        -
        -targets:
        -  dev:
        -    default: true
        -    mode: development
        -    workspace:
        -      host: [DATABRICKS_URL]
        -
        ->>> cat resources/out.job.yml
        -resources:
        -  jobs:
        -    out:
        -      name: gitjob
        -      tasks:
        -        - task_key: test_task
        -          notebook_task:
        -            notebook_path: ../src/outnotebook.py
        +Exit code: 1

latest (v1.24.0): same output as main (e1b8c92)

TestAccept/bundle/generate/job_init_bare/DMS=true: branch ✅ | main (e1b8c92) ❌ | latest (v1.24.0) ❌

main (e1b8c92):

acceptance_test.go:1342: Diff:
        --- bundle/generate/job_init_bare/output.txt
        +++ /tmp/TestAcceptbundlegeneratejob_init_bareDMS=true2187273877/002/output.txt
        @@ -1,47 +1,25 @@
         
         >>> [CLI] bundle generate job --existing-job-id 1234 --key out --init-bare
        -No databricks.yml found. Initializing a bare bundle skeleton.
        -Welcome to the bare Declarative Automation Bundle template!
        +Error: unknown flag: --init-bare
         
        -This template creates the smallest bundle skeleton, meant for importing existing resources with `databricks bundle generate`.
        +Usage:
        +  databricks bundle generate job [flags]
         
        -Your workspace at [DATABRICKS_URL] is used for initialization.
        +Flags:
        +  -d, --config-dir string             Dir path where the output config will be stored (default "resources")
        +      --download-spark-python-files   download workspace files referenced by spark_python_task and rewrite them to a relative path
        +      --existing-job-id int           Job ID of the job to generate config for
        +  -f, --force                         Force overwrite existing files in the output directory
        +  -h, --help                          help for job
        +  -s, --source-dir string             Dir path where the downloaded files will be stored (default "src")
         
        -✨ Your bare bundle has been created.
        +Global Flags:
        +      --debug            enable debug logging
        +      --key string       resource key to use for the generated configuration
        +  -o, --output type      output type: text or json (default text)
        +  -p, --profile string   ~/.databrickscfg profile
        +  -t, --target string    bundle target to use (if applicable)
        +      --var strings      set values for variables defined in bundle config. Example: --var="foo=bar"
         
        -Add generated resources under `resources/` and supporting code under `src/`.
        -File successfully saved to src/outnotebook.py
        -Job configuration successfully saved to resources/out.job.yml
         
        ->>> find.py ^(resources|src)/
        -resources/.gitkeep
        -resources/out.job.yml
        -src/.gitkeep
        -src/outnotebook.py
        -
        ->>> cat databricks.yml
        -# This is a Declarative Automation Bundle definition for my_project.
        -# See https://docs.databricks.com/dev-tools/bundles/index.html for documentation.
        -bundle:
        -  name: my_project
        -  uuid: [UUID]
        -
        -include:
        -  - resources/*.yml
        -
        -targets:
        -  dev:
        -    default: true
        -    mode: development
        -    workspace:
        -      host: [DATABRICKS_URL]
        -
        ->>> cat resources/out.job.yml
        -resources:
        -  jobs:
        -    out:
        -      name: gitjob
        -      tasks:
        -        - task_key: test_task
        -          notebook_task:
        -            notebook_path: ../src/outnotebook.py
        +Exit code: 1

latest (v1.24.0):

acceptance_test.go:1342: Diff:
        --- bundle/generate/job_init_bare/output.txt
        +++ /tmp/TestAcceptbundlegeneratejob_init_bareDMS=true1559817044/002/output.txt
        @@ -1,47 +1,25 @@
         
         >>> [CLI] bundle generate job --existing-job-id 1234 --key out --init-bare
        -No databricks.yml found. Initializing a bare bundle skeleton.
        -Welcome to the bare Declarative Automation Bundle template!
        +Error: unknown flag: --init-bare
         
        -This template creates the smallest bundle skeleton, meant for importing existing resources with `databricks bundle generate`.
        +Usage:
        +  databricks bundle generate job [flags]
         
        -Your workspace at [DATABRICKS_URL] is used for initialization.
        +Flags:
        +  -d, --config-dir string             Dir path where the output config will be stored (default "resources")
        +      --download-spark-python-files   download workspace files referenced by spark_python_task and rewrite them to a relative path
        +      --existing-job-id int           Job ID of the job to generate config for
        +  -f, --force                         Force overwrite existing files in the output directory
        +  -h, --help                          help for job
        +  -s, --source-dir string             Dir path where the downloaded files will be stored (default "src")
         
        -✨ Your bare bundle has been created.
        +Global Flags:
        +      --debug            enable debug logging
        +      --key string       resource key to use for the generated configuration
        +  -o, --output type      output type: text or json (default text)
        +  -p, --profile string   ~/.databrickscfg profile
        +  -t, --target string    bundle target to use (if applicable)
        +      --var strings      set values for variables defined in bundle config. Example: --var="foo=bar"
         
        -Add generated resources under `resources/` and supporting code under `src/`.
        -File successfully saved to src/outnotebook.py
        -Job configuration successfully saved to resources/out.job.yml
         
        ->>> find.py ^(resources|src)/
        -resources/.gitkeep
        -resources/out.job.yml
        -src/.gitkeep
        -src/outnotebook.py
        -
        ->>> cat databricks.yml
        -# This is a Declarative Automation Bundle definition for my_project.
        -# See https://docs.databricks.com/dev-tools/bundles/index.html for documentation.
        -bundle:
        -  name: my_project
        -  uuid: [UUID]
        -
        -include:
        -  - resources/*.yml
        -
        -targets:
        -  dev:
        -    default: true
        -    mode: development
        -    workspace:
        -      host: [DATABRICKS_URL]
        -
        ->>> cat resources/out.job.yml
        -resources:
        -  jobs:
        -    out:
        -      name: gitjob
        -      tasks:
        -        - task_key: test_task
        -          notebook_task:
        -            notebook_path: ../src/outnotebook.py
        +Exit code: 1
        
FAIL
TestAccept/bundle/help/bundle-generate-dashboard/DMS=: branch ✅ | main (e1b8c92) ❌ | latest (v1.24.0) ❌

main (e1b8c92):

acceptance_test.go:1342: Diff:
        --- bundle/help/bundle-generate-dashboard/output.txt
        +++ /tmp/TestAcceptbundlehelpbundle-generate-dashboardDMS=1697810930/002/output.txt
        @@ -47,7 +47,6 @@
         
         Global Flags:
               --debug            enable debug logging
        -      --init-bare        create a bare bundle in the current directory if there is no databricks.yml yet
               --key string       resource key to use for the generated configuration
           -o, --output type      output type: text or json (default text)
           -p, --profile string   ~/.databrickscfg profile

latest (v1.24.0): same output as main (e1b8c92)

TestAccept/bundle/help/bundle-generate-dashboard/DMS=true: branch ✅ | main (e1b8c92) ❌ | latest (v1.24.0) ❌

main (e1b8c92):

acceptance_test.go:1342: Diff:
        --- bundle/help/bundle-generate-dashboard/output.txt
        +++ /tmp/TestAcceptbundlehelpbundle-generate-dashboardDMS=true2822913527/002/output.txt
        @@ -47,7 +47,6 @@
         
         Global Flags:
               --debug            enable debug logging
        -      --init-bare        create a bare bundle in the current directory if there is no databricks.yml yet
               --key string       resource key to use for the generated configuration
           -o, --output type      output type: text or json (default text)
           -p, --profile string   ~/.databrickscfg profile

latest (v1.24.0): same output as main (e1b8c92)

TestAccept/bundle/help/bundle-generate-job/DMS=: branch ✅ | main (e1b8c92) ❌ | latest (v1.24.0) ❌

main (e1b8c92):

acceptance_test.go:1342: Diff:
        --- bundle/help/bundle-generate-job/output.txt
        +++ /tmp/TestAcceptbundlehelpbundle-generate-jobDMS=601099758/002/output.txt
        @@ -38,7 +38,6 @@
         
         Global Flags:
               --debug            enable debug logging
        -      --init-bare        create a bare bundle in the current directory if there is no databricks.yml yet
               --key string       resource key to use for the generated configuration
           -o, --output type      output type: text or json (default text)
           -p, --profile string   ~/.databrickscfg profile

latest (v1.24.0): same output as main (e1b8c92)

TestAccept/bundle/help/bundle-generate-job/DMS=true: branch ✅ | main (e1b8c92) ❌ | latest (v1.24.0) ❌

main (e1b8c92):

acceptance_test.go:1342: Diff:
        --- bundle/help/bundle-generate-job/output.txt
        +++ /tmp/TestAcceptbundlehelpbundle-generate-jobDMS=true103671556/002/output.txt
        @@ -38,7 +38,6 @@
         
         Global Flags:
               --debug            enable debug logging
        -      --init-bare        create a bare bundle in the current directory if there is no databricks.yml yet
               --key string       resource key to use for the generated configuration
           -o, --output type      output type: text or json (default text)
           -p, --profile string   ~/.databrickscfg profile

latest (v1.24.0): same output as main (e1b8c92)

TestAccept/bundle/help/bundle-generate-pipeline/DMS=: branch ✅ | main (e1b8c92) ❌ | latest (v1.24.0) ❌

main (e1b8c92):

acceptance_test.go:1342: Diff:
        --- bundle/help/bundle-generate-pipeline/output.txt
        +++ /tmp/TestAcceptbundlehelpbundle-generate-pipelineDMS=3644044477/002/output.txt
        @@ -36,7 +36,6 @@
         
         Global Flags:
               --debug            enable debug logging
        -      --init-bare        create a bare bundle in the current directory if there is no databricks.yml yet
               --key string       resource key to use for the generated configuration
           -o, --output type      output type: text or json (default text)
           -p, --profile string   ~/.databrickscfg profile

latest (v1.24.0): same output as main (e1b8c92)

TestAccept/bundle/help/bundle-generate-pipeline/DMS=true: branch ✅ | main (e1b8c92) ❌ | latest (v1.24.0) ❌

main (e1b8c92):

acceptance_test.go:1342: Diff:
        --- bundle/help/bundle-generate-pipeline/output.txt
        +++ /tmp/TestAcceptbundlehelpbundle-generate-pipelineDMS=true2528886079/002/output.txt
        @@ -36,7 +36,6 @@
         
         Global Flags:
               --debug            enable debug logging
        -      --init-bare        create a bare bundle in the current directory if there is no databricks.yml yet
               --key string       resource key to use for the generated configuration
           -o, --output type      output type: text or json (default text)
           -p, --profile string   ~/.databrickscfg profile
        
FAIL

latest (v1.24.0):

acceptance_test.go:1342: Diff:
        --- bundle/help/bundle-generate-pipeline/output.txt
        +++ /tmp/TestAcceptbundlehelpbundle-generate-pipelineDMS=true1958021248/002/output.txt
        @@ -36,7 +36,6 @@
         
         Global Flags:
               --debug            enable debug logging
        -      --init-bare        create a bare bundle in the current directory if there is no databricks.yml yet
               --key string       resource key to use for the generated configuration
           -o, --output type      output type: text or json (default text)
           -p, --profile string   ~/.databrickscfg profile
TestAccept/bundle/help/bundle-generate/DMS=: branch ✅ | main (e1b8c92) ❌ | latest (v1.24.0) ❌

main (e1b8c92):

acceptance_test.go:1342: Diff:
        --- bundle/help/bundle-generate/output.txt
        +++ /tmp/TestAcceptbundlehelpbundle-generateDMS=1789873266/002/output.txt
        @@ -8,7 +8,6 @@
           databricks bundle generate dashboard --existing-path /my-dashboard --key sales_dash
           databricks bundle generate dashboard --resource my_dashboard --watch --force  # Keep local copy in sync. Useful for development.
           databricks bundle generate dashboard --resource my_dashboard --force # Do a one-time sync.
        -  databricks bundle generate job --existing-job-id 123 --init-bare  # Start a new bundle from an existing job.
         
         Migration workflows:
         
        @@ -23,7 +22,6 @@
         
         Use --key to specify the resource name in your bundle configuration.
         Use --bind to automatically bind the generated resource to the existing workspace resource.
        -Use --init-bare to create a bare bundle in the current directory when there is no databricks.yml yet.
         
         Usage:
           databricks bundle generate [command]
        @@ -38,7 +36,6 @@
         
         Flags:
           -h, --help         help for generate
        -      --init-bare    create a bare bundle in the current directory if there is no databricks.yml yet
               --key string   resource key to use for the generated configuration
         
         Global Flags:

latest (v1.24.0): same output as main (e1b8c92)

TestAccept/bundle/help/bundle-generate/DMS=true: branch ✅ | main (e1b8c92) ❌ | latest (v1.24.0) ❌

main (e1b8c92):

acceptance_test.go:1342: Diff:
        --- bundle/help/bundle-generate/output.txt
        +++ /tmp/TestAcceptbundlehelpbundle-generateDMS=true2337164863/002/output.txt
        @@ -8,7 +8,6 @@
           databricks bundle generate dashboard --existing-path /my-dashboard --key sales_dash
           databricks bundle generate dashboard --resource my_dashboard --watch --force  # Keep local copy in sync. Useful for development.
           databricks bundle generate dashboard --resource my_dashboard --force # Do a one-time sync.
        -  databricks bundle generate job --existing-job-id 123 --init-bare  # Start a new bundle from an existing job.
         
         Migration workflows:
         
        @@ -23,7 +22,6 @@
         
         Use --key to specify the resource name in your bundle configuration.
         Use --bind to automatically bind the generated resource to the existing workspace resource.
        -Use --init-bare to create a bare bundle in the current directory when there is no databricks.yml yet.
         
         Usage:
           databricks bundle generate [command]
        @@ -38,7 +36,6 @@
         
         Flags:
           -h, --help         help for generate
        -      --init-bare    create a bare bundle in the current directory if there is no databricks.yml yet
               --key string   resource key to use for the generated configuration
         
         Global Flags:

latest (v1.24.0): same output as main (e1b8c92)

TestAccept/bundle/help/bundle-init/DMS=: branch ✅ | main (e1b8c92) ❌ | latest (v1.24.0) ❌

main (e1b8c92):

acceptance_test.go:1342: Diff:
        --- bundle/help/bundle-init/output.txt
        +++ /tmp/TestAcceptbundlehelpbundle-initDMS=1033207433/002/output.txt
        @@ -6,7 +6,6 @@
         - default-python: The default Python template for Notebooks and Lakeflow
         - default-sql: The default SQL template for .sql files that run with Databricks SQL
         - default-minimal: The minimal template, for advanced users
        -- default-bare: The bare template for importing existing resources
         - default-scala: The default Scala template for JAR jobs
         - lakeflow-integrations: The template for Lakeflow integrations
         - dbt-sql: The dbt SQL template (databricks.com/blog/delivering-cost-effective-data-real-time-dbt-and-databricks)

latest (v1.24.0): same output as main (e1b8c92)

TestAccept/bundle/help/bundle-init/DMS=true: branch ✅ | main (e1b8c92) ❌ | latest (v1.24.0) ❌

main (e1b8c92):

acceptance_test.go:1342: Diff:
        --- bundle/help/bundle-init/output.txt
        +++ /tmp/TestAcceptbundlehelpbundle-initDMS=true3035580635/002/output.txt
        @@ -6,7 +6,6 @@
         - default-python: The default Python template for Notebooks and Lakeflow
         - default-sql: The default SQL template for .sql files that run with Databricks SQL
         - default-minimal: The minimal template, for advanced users
        -- default-bare: The bare template for importing existing resources
         - default-scala: The default Scala template for JAR jobs
         - lakeflow-integrations: The template for Lakeflow integrations
         - dbt-sql: The dbt SQL template (databricks.com/blog/delivering-cost-effective-data-real-time-dbt-and-databricks)

latest (v1.24.0): same output as main (e1b8c92)

TestAccept/bundle/templates/default-bare/minimal/DMS=: branch ✅ | main (e1b8c92) ❌ | latest (v1.24.0) ❌

main (e1b8c92):

acceptance_test.go:1342: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1342
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1083
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:660
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle init default-bare --config-file ./input.json --output-dir output -o json\nWelcome to the bare Declarative Automation Bundle template!\n\nThis template creates the smallest bundle skeleton, meant for importing existing resources with `databricks bundle generate`.\n\nYour workspace at [DATABRICKS_URL] is used for initialization.\n\n✨ Your bare bundle has been created.\n\nAdd generated resources under `resources/` and supporting code under `src/`.\n{\n  \"outputs\": [\n    \".gitignore\",\n    \"README.md\",\n    \"databricks.yml\",\n    \"resources/.gitkeep\",\n    \"src/.gitkeep\"\n  ]\n}\n\n>>> [CLI] bundle validate -t dev\nName: my_bare_bundle\nTarget: dev\nWorkspace:\n  Host: [DATABRICKS_URL]\n  User: [USERNAME]\n  Path: /Workspace/Users/[USERNAME]/.bundle/my_bare_bundle/dev\n\nValidation OK!\n"
        	            	actual  : "\n>>> [CLI] bundle init default-bare --config-file ./input.json --output-dir output -o json\nError: not a bundle template: expected to find a template schema file at databricks_template_schema.json\n\nExit code: 1\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,30 +2,5 @@
        	            	 >>> [CLI] bundle init default-bare --config-file ./input.json --output-dir output -o json
        	            	-Welcome to the bare Declarative Automation Bundle template!
        	            	+Error: not a bundle template: expected to find a template schema file at databricks_template_schema.json
        	            	 
        	            	-This template creates the smallest bundle skeleton, meant for importing existing resources with `databricks bundle generate`.
        	            	+Exit code: 1
        	            	 
        	            	-Your workspace at [DATABRICKS_URL] is used for initialization.
        	            	-
        	            	-✨ Your bare bundle has been created.
        	            	-
        	            	-Add generated resources under `resources/` and supporting code under `src/`.
        	            	-{
        	            	-  "outputs": [
        	            	-    ".gitignore",
        	            	-    "README.md",
        	            	-    "databricks.yml",
        	            	-    "resources/.gitkeep",
        	            	-    "src/.gitkeep"
        	            	-  ]
        	            	-}
        	            	-
        	            	->>> [CLI] bundle validate -t dev
        	            	-Name: my_bare_bundle
        	            	-Target: dev
        	            	-Workspace:
        	            	-  Host: [DATABRICKS_URL]
        	            	-  User: [USERNAME]
        	            	-  Path: /Workspace/Users/[USERNAME]/.bundle/my_bare_bundle/dev
        	            	-
        	            	-Validation OK!
        	            	-
        	Test:       	TestAccept/bundle/templates/default-bare/minimal/DMS=
        	Messages:   	bundle/templates/default-bare/minimal/output.txt vs /tmp/TestAcceptbundletemplatesdefault-bareminimalDMS=1596631643/002/output.txt
    acceptance_test.go:1313: Missing output file: output/README.md
    acceptance_test.go:1313: Missing output file: output/databricks.yml
    acceptance_test.go:1313: Missing output file: output/out.gitignore
    acceptance_test.go:1313: Missing output file: output/resources/.gitkeep
    acceptance_test.go:1313: Missing output file: output/src/.gitkeep

latest (v1.24.0): same output as main (e1b8c92)

@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 7507ca6

Run: 41862303672

Env 🔄​flaky ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 271 23 6:34
✅​ aws-windows-latest-4core-16gb 273 21 3:53
✅​ azure linux-2core-8gb 270 23 5:29
✅​ azure-windows-latest-4core-16gb 272 21 3:40
✅​ gcp linux-2core-8gb 271 23 6:08
🔄​ gcp-windows-latest-4core-16gb 4 269 21 4:14
Test Name gcp-windows-latest-4core-16gb
🔄​ TestFsCpDirToDirFileNotOverwritten 🔄​f
🔄​ TestFsCpDirToDirFileNotOverwritten/dbfs_to_uc-volumes 🔄​f
🔄​ TestFilerRecursiveDelete 🔄​f
🔄​ TestFilerRecursiveDelete/files 🔄​f
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:36 gcp-windows-latest-4core-16gb TestAccept
3:33 azure-windows-latest-4core-16gb TestAccept
3:31 aws-windows-latest-4core-16gb TestAccept

@janniklasrose

Copy link
Copy Markdown
Member Author

Closing: --init-bare / default-bare is not wanted; bundle init empty covers it. The generate-for-all-resources work continues on a fresh branch.

@janniklasrose
janniklasrose deleted the janniklasrose/bundle-generate-init-bare branch November 4, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants