Skip to content

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

Open
varundeepsaini wants to merge 1 commit intodatabricks:mainfrom
varundeepsaini:fix/bundle-generate-job
Open

Fix bundle generate job to preserve nested notebook directory structure#4596
varundeepsaini wants to merge 1 commit intodatabricks: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
Copy link
Copy Markdown
Collaborator

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

Commit: baac699

Run: 23651964164

Env 🟨​KNOWN 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 10 270 808 7:29
🟨​ aws windows 7 10 272 806 6:12
💚​ aws-ucws linux 7 10 366 724 7:00
💚​ aws-ucws windows 7 10 368 722 6:46
💚​ azure linux 1 12 273 806 6:10
💚​ azure windows 1 12 275 804 5:06
💚​ azure-ucws linux 1 12 371 720 8:57
💚​ azure-ucws windows 1 12 373 718 6:19
💚​ gcp linux 1 12 269 809 5:57
💚​ gcp windows 1 12 271 807 5:20
17 interesting tests: 10 SKIP, 7 KNOWN
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp 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):
duration env testname
4:37 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:36 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:42 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:42 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:15 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:15 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:12 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:49 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:49 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:48 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:48 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:48 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:45 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:45 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:43 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:43 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:42 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:38 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:15 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:13 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform

@varundeepsaini varundeepsaini force-pushed the fix/bundle-generate-job branch from dc572e1 to 6a23c44 Compare February 27, 2026 17:08
@varundeepsaini
Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

@andrewnester andrewnester left a comment

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 varundeepsaini force-pushed the fix/bundle-generate-job branch from 6a23c44 to 545af5c Compare March 3, 2026 09:46
@varundeepsaini
Copy link
Copy Markdown
Contributor Author

@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 varundeepsaini force-pushed the fix/bundle-generate-job branch 2 times, most recently from 2e1b40d to 7f9bca0 Compare March 4, 2026 17:16
@varundeepsaini
Copy link
Copy Markdown
Contributor Author

@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 varundeepsaini force-pushed the fix/bundle-generate-job branch from 7f9bca0 to 8a557b2 Compare March 11, 2026 10:38
@varundeepsaini
Copy link
Copy Markdown
Contributor Author

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

@varundeepsaini varundeepsaini force-pushed the fix/bundle-generate-job branch from d7db5b1 to 454eb63 Compare March 17, 2026 14:52
@varundeepsaini
Copy link
Copy Markdown
Contributor Author

@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

@andrewnester andrewnester enabled auto-merge March 27, 2026 10:53
@varundeepsaini
Copy link
Copy Markdown
Contributor Author

@andrewnester could you run the ci ?
Thankss

@varundeepsaini
Copy link
Copy Markdown
Contributor Author

@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 varundeepsaini force-pushed the fix/bundle-generate-job branch from 1f9e016 to baac699 Compare March 27, 2026 14:42
@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: 4596
  • Commit SHA: baac699fc15b7d763e1be2689a4c11b120e17271

Checks will be approved automatically on success.

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.

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

3 participants