Skip to content

Immutable folder support in DABs#5254

Open
andrewnester wants to merge 29 commits into
mainfrom
demo-immutable
Open

Immutable folder support in DABs#5254
andrewnester wants to merge 29 commits into
mainfrom
demo-immutable

Conversation

@andrewnester

@andrewnester andrewnester commented May 15, 2026

Copy link
Copy Markdown
Contributor

Changes

Added support for deploying bundles to immutable folders in the workspace

When experimental.immutable_folder: true is set, the CLI packages all bundle source files and built artifacts into a single zip archive and uploads it as a content-addressed, immutable snapshot. The snapshot path is derived from the content hash of the zip, so identical code always lands at the same location and re-deploying an unchanged bundle is a no-op at the storage layer.

This mode is currently supported with the direct deployment engine only (DATABRICKS_BUNDLE_ENGINE=direct).

Example databricks.yml:

bundle:
  name: my-bundle

experimental:
  immutable_folder: true

resources:
  jobs:
    my_job:
      name: my-job
      tasks:
        - task_key: main
          python_script_task:
            python_file: ./src/main.py

After bundle deploy, the job's python_file resolves to a path like:

/Workspace/Users/[UUID]/.snapshots///src/files/src/main.py

Tests

Added an acceptance tests

@andrewnester andrewnester requested a review from pietern May 15, 2026 09:56
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 60e41d3

Run: 28107757408

Env ❌​FAIL 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 7 13 244 1028 5:25
💚​ aws windows 7 13 246 1026 6:28
💚​ aws-ucws linux 7 13 334 944 6:54
💚​ aws-ucws windows 7 13 336 942 7:23
❌​ azure linux 3 1 15 244 1026 15:11
❌​ azure windows 2 4 15 244 1024 16:02
❌​ azure-ucws linux 3 1 15 336 940 11:11
🔄​ azure-ucws windows 4 15 338 938 9:35
💚​ gcp linux 1 15 246 1028 4:48
💚​ gcp windows 1 15 248 1026 5:30
25 interesting tests: 13 SKIP, 6 RECOVERED, 3 flaky, 3 FAIL
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 💚​R 💚​R 💚​R 💚​R 💚​R 🔄​f 💚​R 🔄​f 💚​R 💚​R
🔄​ TestAccept/bundle/generate/alert ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p 🔄​f ✅​p ✅​p
🔄​ TestAccept/bundle/generate/alert/DATABRICKS_BUNDLE_ENGINE=terraform ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p 🔄​f ✅​p ✅​p
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​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/replace_existing 🙈​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_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/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
❌​ TestFetchRepositoryInfoAPI_FromRepo ✅​p ✅​p ✅​p ✅​p ❌​F ❌​F ❌​F 🔄​f ✅​p ✅​p
❌​ TestFetchRepositoryInfoAPI_FromRepo/root ✅​p ✅​p ✅​p ✅​p ❌​F ❌​F ❌​F ✅​p ✅​p ✅​p
❌​ TestFetchRepositoryInfoAPI_FromRepo/subdir ✅​p ✅​p ✅​p ✅​p ❌​F 🔄​f ❌​F ✅​p ✅​p ✅​p
Top 22 slowest tests (at least 2 minutes):
duration env testname
3:33 aws windows TestAccept
3:28 azure windows TestAccept/bundle/generate/auto-bind/DATABRICKS_BUNDLE_ENGINE=terraform
3:23 azure windows TestAccept/bundle/deploy/mlops-stacks/DATABRICKS_BUNDLE_ENGINE=terraform
3:18 azure windows TestAccept/bundle/deploy/mlops-stacks/DATABRICKS_BUNDLE_ENGINE=direct
3:07 aws-ucws windows TestAccept
3:05 gcp windows TestAccept
2:59 azure windows TestFilerReadWrite/workspace_files
2:50 azure windows TestAccept/bundle/deployment/bind/job/generate-and-bind/DATABRICKS_BUNDLE_ENGINE=terraform
2:45 azure windows TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_BUNDLE_ENGINE=terraform
2:45 azure windows TestAccept/bundle/deployment/bind/job/generate-and-bind/DATABRICKS_BUNDLE_ENGINE=direct
2:39 azure linux TestAccept/bundle/deploy/mlops-stacks/DATABRICKS_BUNDLE_ENGINE=direct
2:30 azure linux TestAccept/bundle/run_as/job_default/DATABRICKS_BUNDLE_ENGINE=direct
2:30 azure-ucws windows TestAccept/bundle/deployment/bind/job/generate-and-bind/DATABRICKS_BUNDLE_ENGINE=terraform
2:23 azure linux TestFilerReadWrite/workspace_files_extensions
2:22 azure windows TestAccept/bundle/run_as/job_default/DATABRICKS_BUNDLE_ENGINE=direct
2:20 azure linux TestFilerWorkspaceFilesExtensionsReadDir
2:20 azure linux TestAccept/bundle/generate/auto-bind/DATABRICKS_BUNDLE_ENGINE=terraform
2:11 azure linux TestAccept/bundle/deploy/mlops-stacks/DATABRICKS_BUNDLE_ENGINE=terraform
2:09 azure-ucws windows TestAccept/bundle/generate/auto-bind/DATABRICKS_BUNDLE_ENGINE=terraform
2:09 azure windows TestLock
2:04 azure linux TestAccept/bundle/deployment/bind/job/generate-and-bind/DATABRICKS_BUNDLE_ENGINE=direct
2:01 azure windows TestImportDirWithOverwriteFlag

@andrewnester andrewnester marked this pull request as ready for review June 1, 2026 11:34
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

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

/bundle/ - needs approval

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

/libs/sync/ - needs approval

Files: libs/sync/sync.go
Suggested: @simonfaltum
Also eligible: @tanmay-db, @Divyansh-db, @renaudhartert-db, @parthban-db, @hectorcast-db, @tejaskochar-db, @mihaimitrea-db, @chrisst, @rauchy

General files (require maintainer)

Files: acceptance/bin/print_requests.py, libs/testserver/handlers.go
Based on git history:

  • @denik -- recent work in bundle/direct/, bundle/phases/, bundle/config/mutator/

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

@andrewnester andrewnester requested a review from denik June 2, 2026 10:01

@shreyas-goenka shreyas-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.

Minor comments - other than the bit where we use metadata.json

Comment thread bundle/phases/deploy.go Outdated
Comment thread bundle/metadata/metadata.go Outdated
@@ -15,6 +15,9 @@ type Bundle struct {

type Workspace struct {
FilePath string `json:"file_path"`
// SnapshotPath is the workspace path of the immutable snapshot uploaded
// during deployment. Only populated for bundles with bundle.immutable = true.
SnapshotPath string `json:"snapshot_path,omitempty"`

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.

Will the UI use the immutable snapshot path? In that case we'll need to add it to DMS as well.

Comment thread bundle/deploy/snapshot/upload.go Outdated
Comment thread bundle/deploy/snapshot/client.go
Comment thread bundle/deploy/snapshot/path_test.go Outdated
Comment thread bundle/deploy/metadata/load.go Outdated
Comment thread bundle/config/mutator/translate_paths.go Outdated
Comment thread bundle/config/mutator/resolve_variable_references.go
Comment thread bundle/config/mutator/resourcemutator/process_static_resources.go Outdated
Comment thread acceptance/bundle/deploy/immutable/output.txt Outdated
@andrewnester andrewnester requested a review from pietern June 23, 2026 11:00
Comment thread acceptance/bundle/deploy/immutable/output.txt Outdated
Comment thread bundle/config/mutator/resolve_variable_references.go
Comment thread bundle/phases/deploy.go Outdated
Comment thread bundle/phases/destroy.go Outdated
Comment thread bundle/phases/destroy.go Outdated
// Allows running the full test suite against the immutable folder code path without
// modifying any databricks.yml files.
mutator.OverrideImmutableFolder(),

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.

Is this test only?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is only used for test

Comment thread libs/sync/sync.go
})
}
return acl
}

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: can live in a different file.

Comment thread bundle/deploy/ensure_deployment_id.go Outdated
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.

4 participants