Skip to content

bundle migrate: handle added/removed resources gracefully#5463

Open
denik wants to merge 1 commit into
mainfrom
denik/migration-added-removed
Open

bundle migrate: handle added/removed resources gracefully#5463
denik wants to merge 1 commit into
mainfrom
denik/migration-added-removed

Conversation

@denik
Copy link
Copy Markdown
Contributor

@denik denik commented Jun 8, 2026

Changes

  • Update "bundle deployment migrate" to support added/removed resources:
    • If resource is present in databricks.yml but not in terraform state the migrate command no longer fails, it skips the resource, it'll be deployed by direct engine.
    • If resource is present in the state but not in databricks.yml, migration preserves their ID in the state so that it can be deleted by direct engine.

Why

Towards auto-migration: we should migrate any situation without errors.

Tests

New acceptance tests.

@denik denik temporarily deployed to test-trigger-is June 8, 2026 09:36 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 8, 2026 09:36 — with GitHub Actions Inactive
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 8, 2026

Approval status: pending

/acceptance/bundle/ - needs approval

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

/bundle/ - needs approval

Files: bundle/direct/bundle_apply.go
Suggested: @pietern
Also eligible: @janniklasrose, @shreyas-goenka, @andrewnester, @lennartkats-db, @anton-107

/cmd/bundle/ - needs approval

Files: cmd/bundle/deployment/migrate.go
Suggested: @pietern
Also eligible: @janniklasrose, @shreyas-goenka, @andrewnester, @lennartkats-db, @anton-107

General files (require maintainer)

Files: NEXT_CHANGELOG.md
Based on git history:

  • @simonfaltum -- recent work in ./

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

@eng-dev-ecosystem-bot
Copy link
Copy Markdown
Collaborator

eng-dev-ecosystem-bot commented Jun 8, 2026

Commit: f9b0ae3

Run: 27138874071

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 15 261 925 9:11
🟨​ aws windows 7 3 15 260 923 17:36
💚​ aws-ucws linux 7 15 357 839 8:38
💚​ aws-ucws windows 7 15 359 837 12:27
🔄​ azure linux 1 1 17 263 923 8:31
🔄​ azure windows 3 17 264 921 12:56
💚​ azure-ucws linux 1 17 362 835 8:36
💚​ azure-ucws windows 1 17 364 833 12:04
💚​ gcp linux 1 17 260 926 9:31
💚​ gcp windows 1 17 262 924 13:21
28 interesting tests: 15 SKIP, 7 KNOWN, 6 flaky
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 🔄​f 💚​R 💚​R 💚​R 💚​R
🔄​ TestAccept/bundle/destroy/jobs-and-pipeline ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p
🔄​ TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_BUNDLE_ENGINE=direct ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​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 🟨​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/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_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/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/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/grants/select 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestAccept/selftest/record_cloud/pipeline-crud ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestAccept/selftest/record_cloud/pipeline-crud/DATABRICKS_BUNDLE_ENGINE=direct ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestAccept/selftest/record_cloud/pipeline-crud/DATABRICKS_BUNDLE_ENGINE=terraform ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestFetchRepositoryInfoAPI_FromRepo ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p
Top 27 slowest tests (at least 2 minutes):
duration env testname
6:06 gcp windows TestAccept
6:04 azure-ucws windows TestAccept
5:59 aws-ucws windows TestAccept
5:33 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
5:00 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:46 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:36 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:43 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:34 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:24 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:11 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:08 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:07 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:07 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:02 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:59 azure linux TestAccept
2:55 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:54 gcp linux TestAccept
2:54 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:48 azure-ucws linux TestAccept
2:46 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:46 aws-ucws linux TestAccept
2:46 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:46 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:45 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:44 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:29 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct

@denik denik force-pushed the denik/migration-added-removed branch from 1117995 to fe0d059 Compare June 8, 2026 11:05
@denik denik temporarily deployed to test-trigger-is June 8, 2026 11:06 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 8, 2026 11:06 — with GitHub Actions Inactive
@denik denik force-pushed the denik/migration-added-removed branch from fe0d059 to b4d3e40 Compare June 8, 2026 11:18
@denik denik temporarily deployed to test-trigger-is June 8, 2026 11:19 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 8, 2026 11:19 — with GitHub Actions Inactive
@denik denik force-pushed the denik/migration-added-removed branch from b4d3e40 to 7bf336c Compare June 8, 2026 12:23
@denik denik temporarily deployed to test-trigger-is June 8, 2026 12:24 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 8, 2026 12:24 — with GitHub Actions Inactive
@denik denik force-pushed the denik/migration-added-removed branch from 7bf336c to f7c3b39 Compare June 8, 2026 12:26
@denik denik temporarily deployed to test-trigger-is June 8, 2026 12:27 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 8, 2026 12:27 — with GitHub Actions Inactive
@denik denik force-pushed the denik/migration-added-removed branch from f7c3b39 to f9b0ae3 Compare June 8, 2026 12:50
@denik denik temporarily deployed to test-trigger-is June 8, 2026 12:51 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 8, 2026 12:51 — with GitHub Actions Inactive
Resources in databricks.yml but not in terraform state (added since
last deploy) are now skipped during migration and will be created on
the first direct deploy, instead of failing the migration.

Resources in terraform state but not in databricks.yml (removed since
last deploy) now have their ID preserved in the direct state so the
next direct deploy will plan and execute deletion, instead of failing
the migration.

Co-authored-by: Isaac
@denik denik force-pushed the denik/migration-added-removed branch from f9b0ae3 to bb2f595 Compare June 8, 2026 12:53
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.

2 participants