Skip to content

direct: fix migrate of model_serving_endpoints and database_instances permissions#5775

Merged
denik merged 5 commits into
mainfrom
denik/investigate-migration
Jun 30, 2026
Merged

direct: fix migrate of model_serving_endpoints and database_instances permissions#5775
denik merged 5 commits into
mainfrom
denik/investigate-migration

Conversation

@denik

@denik denik commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Changes

bundle deployment migrate aborted with cannot resolve field "object_id" for model_serving_endpoints and database_instances with permissions: the object_id was re-derived from the parent's terraform state (endpoint_id / id), but those fields aren't present there.

Set object_id from the .permissions node's own terraform state ID (tfIDs[node] — the databricks_permissions resource ID, already the full /serving-endpoints/<id> etc.) instead of resolving it from the parent. Uniform across all resource types.

Regression from #5399 (tfstate-only migrate); the previous impl read the value from remote state.

Tests

New invariant configs (migrate / no_drift / continue_293) and unit cases in build_state_test.go, confirmed failing without the fix.

This pull request and its description were written by Isaac.

…base_instances

Adds invariant configs for model_serving_endpoints and database_instances with
permissions. They pass no_drift and continue_293 but are excluded from the migrate
invariant: migrate can't resolve the permissions object_id from terraform state for
these types (the endpoint_id / id field is absent from tfstate). This is a regression
introduced by #5399; the previous migrate impl read it from remote state.

Co-authored-by: Isaac
@denik denik temporarily deployed to test-trigger-is June 30, 2026 11:29 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 30, 2026 11:29 — with GitHub Actions Inactive
… permissions

The permissions object_id was re-derived from the parent resource's terraform
state (endpoint_id for serving endpoints, id for database instances), but those
fields aren't present in tfstate for these types, so migrate aborted with
"cannot resolve field object_id".

Take object_id from the permissions node's own terraform state ID instead, which
already holds the full object id (e.g. "/serving-endpoints/<id>"). This is uniform
across all resource types and removes the dependency on the parent's tfstate shape.

Removes the migrate-invariant exclusions added earlier so both configs now run, and
adds unit coverage in build_state_test.go.

Co-authored-by: Isaac
@denik denik changed the title acc: cover permissions migration for model_serving_endpoints and database_instances direct: fix migrate of model_serving_endpoints and database_instances permissions Jun 30, 2026
@denik denik temporarily deployed to test-trigger-is June 30, 2026 11:39 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 30, 2026 11:39 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 8ab146c

Run: 28444920455

Env 🟨​KNOWN 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 8 13 231 1037 4:04
🟨​ aws windows 7 1 13 233 1035 5:59
💚​ aws-ucws linux 8 13 315 955 5:03
💚​ aws-ucws windows 8 13 317 953 3:14
💚​ azure linux 2 15 231 1036 3:52
💚​ azure windows 2 15 233 1034 2:47
💚​ azure-ucws linux 2 15 317 952 4:32
💚​ azure-ucws windows 2 15 319 950 3:32
💚​ gcp linux 2 15 230 1038 3:29
💚​ gcp windows 2 15 232 1036 2:55
21 interesting tests: 13 SKIP, 7 KNOWN, 1 RECOVERED
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 🟨​K 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ 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 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 💚​R 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 🟨​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_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 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R

Name the `id` variable (tfIDs[node]) as the source.

Co-authored-by: Isaac
@denik denik temporarily deployed to test-trigger-is June 30, 2026 12:15 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 30, 2026 12:15 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 30, 2026 12:37 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 30, 2026 12:37 — with GitHub Actions Inactive
@denik denik enabled auto-merge June 30, 2026 12:50
@denik denik disabled auto-merge June 30, 2026 13:08
@denik denik enabled auto-merge June 30, 2026 13:08
@denik denik disabled auto-merge June 30, 2026 13:08
@denik denik merged commit 3a3700e into main Jun 30, 2026
26 checks passed
@denik denik deleted the denik/investigate-migration branch June 30, 2026 13:08
denik added a commit that referenced this pull request Jun 30, 2026
## Why
Ensure that all resource have invariant test coverage. Recent example
where lack of coverage caused to release a bug in migrate rewrite
#5775
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