Skip to content

Fix bundle generate job to preserve nested notebook directory structure - #4596

Merged
andrewnester merged 8 commits into
databricks:mainfrom
varundeepsaini:fix/bundle-generate-job
May 8, 2026
Merged

Fix bundle generate job to preserve nested notebook directory structure#4596
andrewnester merged 8 commits into
databricks:mainfrom
varundeepsaini:fix/bundle-generate-job

Conversation

@varundeepsaini

Copy link
Copy Markdown
Contributor

Changes

Fixes#4503.

Add MarkTasksForDownload that computes a common base path across all notebook tasks before downloading, replacing the per-task loop in job.go. This preserves nested directory structure instead of flattening all notebooks into src/.

Tests

  • Unit tests for commonDirPrefix and MarkTasksForDownload.
  • Acceptance test bundle/generate/job_nested_notebooks reproducing the issue.
  • No regressions in existing python_job, ipynb_job, git_job tests.

Test are written by Claude Code

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Feb 27, 2026

Copy link
Copy Markdown
Collaborator

Commit: baac699

Run: 23651964164

Env🟨​KNOWN💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
🟨​aws linux7102708087:29
🟨​aws windows7102728066:12
💚​aws-ucws linux7103667247:00
💚​aws-ucws windows7103687226:46
💚​azure linux1122738066:10
💚​azure windows1122758045:06
💚​azure-ucws linux1123717208:57
💚​azure-ucws windows1123737186:19
💚​gcp linux1122698095:57
💚​gcp windows1122718075:20
17 interesting tests: 10 SKIP, 7 KNOWN
Test Nameaws linuxaws windowsaws-ucws linuxaws-ucws windowsazure linuxazure windowsazure-ucws linuxazure-ucws windowsgcp linuxgcp windows
🟨​TestAccept🟨​K🟨​K💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
🙈​TestAccept/bundle/resources/permissions🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions🟨​K🟨​K💚​R💚​R🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions🟨​K🟨​K💚​R💚​R🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K💚​R💚​R
🙈​TestAccept/bundle/resources/postgres_branches/basic🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/postgres_branches/recreate🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/postgres_branches/update_protected🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/postgres_branches/without_branch_id🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/postgres_endpoints/basic🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/postgres_endpoints/recreate🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/postgres_projects/update_display_name🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/synced_database_tables/basic🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/ssh/connection🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
Top 20 slowest tests (at least 2 minutes):
durationenvtestname
4:37azure-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:36gcp linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:42gcp windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:42azure windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:15gcp linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:15gcp windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:12aws-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:49azure-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:49aws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:48aws-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:48aws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:48aws-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:45azure-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:45azure-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:43azure linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:43aws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:42aws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:38aws-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:15azure linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:13azure windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform

@varundeepsaini

Copy link
Copy Markdown
ContributorAuthor

@andrewnester could you run the checks, there were some issues on windows, have fixed those

@andrewnesterandrewnester 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.

Could you please add a NEXT_CHANGELOG entry for this change, following the format there? Thank you!

@varundeepsaini
varundeepsainiforce-pushed the fix/bundle-generate-job branch from 6a23c44 to 545af5cCompareMarch 3, 2026 09:46
@varundeepsaini

Copy link
Copy Markdown
ContributorAuthor

@andrewnester done.

@andrewnester
andrewnester self-requested a review March 4, 2026 16:11
@andrewnester

Copy link
Copy Markdown
Contributor

@varundeepsaini, this change could break for users who continuously run the "bundle generates job" command to sync the files back. At the very least, can you expand this PR to clean up the files at the old location?

@varundeepsaini
varundeepsainiforce-pushed the fix/bundle-generate-job branch 2 times, most recently from 2e1b40d to 7f9bca0CompareMarch 4, 2026 17:16
@varundeepsaini

Copy link
Copy Markdown
ContributorAuthor

@andrewnester could you run the ci ?
thankss !

@andrewnester

Copy link
Copy Markdown
Contributor

@varundeepsaini sorry for the delay, could you please also resolve merge conflicts?

@varundeepsaini
varundeepsainiforce-pushed the fix/bundle-generate-job branch from 7f9bca0 to 8a557b2CompareMarch 11, 2026 10:38
@varundeepsaini

Copy link
Copy Markdown
ContributorAuthor

@andrewnester no worries, thanks a lot for the reviews
have rebased the pr

Comment threadNEXT_CHANGELOG.md Outdated
@varundeepsaini
varundeepsainiforce-pushed the fix/bundle-generate-job branch from d7db5b1 to 454eb63CompareMarch 17, 2026 14:52
@varundeepsaini

Copy link
Copy Markdown
ContributorAuthor

@andrewnester
Could you please run the ci

I have fixed the windows test failure,
the TestAccept/apps/init-template/app test failure s unrelated to my changes, have rebased

@varundeepsaini

Copy link
Copy Markdown
ContributorAuthor

@andrewnester i fixed the test failures, could you re run the ci
Thankss

auto-merge was automatically disabled March 27, 2026 14:42

Head branch was pushed to by a user without write access

@varundeepsaini
varundeepsainiforce-pushed the fix/bundle-generate-job branch from 1f9e016 to baac699CompareMarch 27, 2026 14:42
@simonfaltum
simonfaltum removed their request for review April 8, 2026 12:27
@varundeepsaini

Copy link
Copy Markdown
ContributorAuthor

@andrewnester
the ci failures look unrelated to my changes.
i think rebasing should work
could you rebase and run the ci again?
Thanksss

@varundeepsaini

Copy link
Copy Markdown
ContributorAuthor

@andrewnester
getting the same error
Error: OIDC token request URL/token not available. Does this job have 'permissions: id-token: write'?

during env setup

@varundeepsaini

Copy link
Copy Markdown
ContributorAuthor

@andrewnester could you run the ci

@varundeepsaini

Copy link
Copy Markdown
ContributorAuthor

@andrewnester bumping this ^^

@andrewnester

Copy link
Copy Markdown
Contributor

@varundeepsaini unfortunately right now CI actions do not work on PRs created from forks, we're working on it

@varundeepsaini

Copy link
Copy Markdown
ContributorAuthor

@andrewnester no worries, thanks for the heads up

@github-actions

Copy link
Copy Markdown
Contributor

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

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 4596
  • Commit SHA: 96fd819615ac87f5426ef95fa76603cf7f60e552

Checks will be approved automatically on success.

@varundeepsaini

Copy link
Copy Markdown
ContributorAuthor

@andrewnester could you approve the ci run

@andrewnester
andrewnester merged commit 2f25245 into databricks:mainMay 8, 2026
15 of 21 checks passed
@varundeepsaini
varundeepsaini deleted the fix/bundle-generate-job branch May 8, 2026 14:54
pietern added a commit that referenced this pull request May 11, 2026
## Summary
- PR #4596 (just merged on main) committed `out.test.toml` for
`acceptance/bundle/generate/job_nested_notebooks` in the pre-#5146
multi-line `[EnvMatrix]` form.
- Regenerated via `go test ./acceptance -run '^TestAccept$'
-only-out-test-toml`.
## Test plan
- [x] `go test ./acceptance -run '^TestAccept$' -only-out-test-toml`
produces only this one-file diff
- [x] `git diff` after regeneration matches the diff CI was reporting
This pull request and its description were written by Isaac.
deco-sdk-taggingBot added a commit that referenced this pull request May 13, 2026
## Release v0.299.2
### Notable Changes
* Breaking change: `vector_search_endpoints` renamed `min_qps` to `target_qps` in DABs configuration and the `vector-search-endpoints` commands, following the SDK rename in v0.131.0. Update any `databricks.yml` using `min_qps:` to `target_qps:` and any CLI invocations using `--min-qps` to `--target-qps`.
### CLI
* `auth login` no longer falls back to plaintext when the OS keyring is reachable but locked. The unlock prompt shown by the probe now runs in parallel with the OAuth flow, and the token is stored in the keyring once the user has typed their password.
* `databricks auth describe` now reports where U2M (`databricks-cli`) tokens are stored: `plaintext` (`~/.databricks/token-cache.json`) or `secure` (OS keyring), and the source of the choice (env var, config setting, or default).
* Marked the default profile in the interactive pickers shown by `databricks auth switch`, `databricks auth logout`, `databricks auth token`, and `databricks auth login`, and moved it to the top of the list. `databricks auth login` and `databricks auth logout` now offer the same selectors as `databricks auth token` and `databricks auth switch` respectively.
* The interactive auth profile pickers now start in search mode so typing immediately filters the list, and the action entries (`+ Create a new profile`, `→ Enter a host URL manually`) are visually distinct from real profiles and stay visible regardless of the search query.
* Shortened the host prompt label shown after `→ Enter a host URL manually` in `databricks auth login` so the prompt no longer leaves stale lines on screen when typing or pasting a host URL.
### Bundles
* Stop applying `presets.name_prefix` (and the dev-mode `[dev <user>]` rename) to `vector_search_endpoints` ([#5209](#5209)).
* Fix `bundle generate` job to preserve nested notebook directory structure ([#4596](#4596))
* Propagate authentication environment (including `DATABRICKS_CONFIG_PROFILE`) to the `experimental.python` subprocess so bundle validate/deploy no longer fails with a multi-profile host ambiguity error when several profiles in `~/.databrickscfg` share the same host.
* Fixed `--force-pull` on `bundle summary` and `bundle open` so the flag bypasses the local state cache and reads state from the workspace.
### Dependency updates
* Bump Go toolchain to 1.25.10 ([#5213](#5213)).
* Bump `github.com/databricks/databricks-sdk-go` from v0.128.0 to v0.132.0.
* Bump Terraform provider to v1.115.0.
denik pushed a commit that referenced this pull request May 20, 2026
…re (#4596)
## Changes
Fixes#4503.
Add `MarkTasksForDownload` that computes a common base path across all
notebook tasks before downloading, replacing the per-task loop in
`job.go`. This preserves nested directory structure instead of
flattening all notebooks into `src/`.
## Tests
- Unit tests for `commonDirPrefix` and `MarkTasksForDownload`.
- Acceptance test `bundle/generate/job_nested_notebooks` reproducing the
issue.
- No regressions in existing `python_job`, `ipynb_job`, `git_job` tests.
Test are written by Claude Code
Co-authored-by: Andrew Nester <andrew.nester.dev@gmail.com>
denik pushed a commit that referenced this pull request May 20, 2026
## Summary
- PR #4596 (just merged on main) committed `out.test.toml` for
`acceptance/bundle/generate/job_nested_notebooks` in the pre-#5146
multi-line `[EnvMatrix]` form.
- Regenerated via `go test ./acceptance -run '^TestAccept$'
-only-out-test-toml`.
## Test plan
- [x] `go test ./acceptance -run '^TestAccept$' -only-out-test-toml`
produces only this one-file diff
- [x] `git diff` after regeneration matches the diff CI was reporting
This pull request and its description were written by Isaac.
denik pushed a commit that referenced this pull request May 20, 2026
## Release v0.299.2
### Notable Changes
* Breaking change: `vector_search_endpoints` renamed `min_qps` to `target_qps` in DABs configuration and the `vector-search-endpoints` commands, following the SDK rename in v0.131.0. Update any `databricks.yml` using `min_qps:` to `target_qps:` and any CLI invocations using `--min-qps` to `--target-qps`.
### CLI
* `auth login` no longer falls back to plaintext when the OS keyring is reachable but locked. The unlock prompt shown by the probe now runs in parallel with the OAuth flow, and the token is stored in the keyring once the user has typed their password.
* `databricks auth describe` now reports where U2M (`databricks-cli`) tokens are stored: `plaintext` (`~/.databricks/token-cache.json`) or `secure` (OS keyring), and the source of the choice (env var, config setting, or default).
* Marked the default profile in the interactive pickers shown by `databricks auth switch`, `databricks auth logout`, `databricks auth token`, and `databricks auth login`, and moved it to the top of the list. `databricks auth login` and `databricks auth logout` now offer the same selectors as `databricks auth token` and `databricks auth switch` respectively.
* The interactive auth profile pickers now start in search mode so typing immediately filters the list, and the action entries (`+ Create a new profile`, `→ Enter a host URL manually`) are visually distinct from real profiles and stay visible regardless of the search query.
* Shortened the host prompt label shown after `→ Enter a host URL manually` in `databricks auth login` so the prompt no longer leaves stale lines on screen when typing or pasting a host URL.
### Bundles
* Stop applying `presets.name_prefix` (and the dev-mode `[dev <user>]` rename) to `vector_search_endpoints` ([#5209](#5209)).
* Fix `bundle generate` job to preserve nested notebook directory structure ([#4596](#4596))
* Propagate authentication environment (including `DATABRICKS_CONFIG_PROFILE`) to the `experimental.python` subprocess so bundle validate/deploy no longer fails with a multi-profile host ambiguity error when several profiles in `~/.databrickscfg` share the same host.
* Fixed `--force-pull` on `bundle summary` and `bundle open` so the flag bypasses the local state cache and reads state from the workspace.
### Dependency updates
* Bump Go toolchain to 1.25.10 ([#5213](#5213)).
* Bump `github.com/databricks/databricks-sdk-go` from v0.128.0 to v0.132.0.
* Bump Terraform provider to v1.115.0.
TanishqDatabricks pushed a commit to TanishqDatabricks/cli that referenced this pull request May 22, 2026
…re (databricks#4596)
## Changes
Fixesdatabricks#4503.
Add `MarkTasksForDownload` that computes a common base path across all
notebook tasks before downloading, replacing the per-task loop in
`job.go`. This preserves nested directory structure instead of
flattening all notebooks into `src/`.
## Tests
- Unit tests for `commonDirPrefix` and `MarkTasksForDownload`.
- Acceptance test `bundle/generate/job_nested_notebooks` reproducing the
issue.
- No regressions in existing `python_job`, `ipynb_job`, `git_job` tests.
Test are written by Claude Code
Co-authored-by: Andrew Nester <andrew.nester.dev@gmail.com>
TanishqDatabricks pushed a commit to TanishqDatabricks/cli that referenced this pull request May 22, 2026
…cks#5228)
## Summary
- PR databricks#4596 (just merged on main) committed `out.test.toml` for
`acceptance/bundle/generate/job_nested_notebooks` in the pre-databricks#5146
multi-line `[EnvMatrix]` form.
- Regenerated via `go test ./acceptance -run '^TestAccept$'
-only-out-test-toml`.
## Test plan
- [x] `go test ./acceptance -run '^TestAccept$' -only-out-test-toml`
produces only this one-file diff
- [x] `git diff` after regeneration matches the diff CI was reporting
This pull request and its description were written by Isaac.
TanishqDatabricks pushed a commit to TanishqDatabricks/cli that referenced this pull request May 22, 2026
## Release v0.299.2
### Notable Changes
* Breaking change: `vector_search_endpoints` renamed `min_qps` to `target_qps` in DABs configuration and the `vector-search-endpoints` commands, following the SDK rename in v0.131.0. Update any `databricks.yml` using `min_qps:` to `target_qps:` and any CLI invocations using `--min-qps` to `--target-qps`.
### CLI
* `auth login` no longer falls back to plaintext when the OS keyring is reachable but locked. The unlock prompt shown by the probe now runs in parallel with the OAuth flow, and the token is stored in the keyring once the user has typed their password.
* `databricks auth describe` now reports where U2M (`databricks-cli`) tokens are stored: `plaintext` (`~/.databricks/token-cache.json`) or `secure` (OS keyring), and the source of the choice (env var, config setting, or default).
* Marked the default profile in the interactive pickers shown by `databricks auth switch`, `databricks auth logout`, `databricks auth token`, and `databricks auth login`, and moved it to the top of the list. `databricks auth login` and `databricks auth logout` now offer the same selectors as `databricks auth token` and `databricks auth switch` respectively.
* The interactive auth profile pickers now start in search mode so typing immediately filters the list, and the action entries (`+ Create a new profile`, `→ Enter a host URL manually`) are visually distinct from real profiles and stay visible regardless of the search query.
* Shortened the host prompt label shown after `→ Enter a host URL manually` in `databricks auth login` so the prompt no longer leaves stale lines on screen when typing or pasting a host URL.
### Bundles
* Stop applying `presets.name_prefix` (and the dev-mode `[dev <user>]` rename) to `vector_search_endpoints` ([databricks#5209](databricks#5209)).
* Fix `bundle generate` job to preserve nested notebook directory structure ([databricks#4596](databricks#4596))
* Propagate authentication environment (including `DATABRICKS_CONFIG_PROFILE`) to the `experimental.python` subprocess so bundle validate/deploy no longer fails with a multi-profile host ambiguity error when several profiles in `~/.databrickscfg` share the same host.
* Fixed `--force-pull` on `bundle summary` and `bundle open` so the flag bypasses the local state cache and reads state from the workspace.
### Dependency updates
* Bump Go toolchain to 1.25.10 ([databricks#5213](databricks#5213)).
* Bump `github.com/databricks/databricks-sdk-go` from v0.128.0 to v0.132.0.
* Bump Terraform provider to v1.115.0.
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.

databricks bundle generate job --existing-job-id flattens notebook directory structure

3 participants

@varundeepsaini@eng-dev-ecosystem-bot@andrewnester