Skip to content

terraform_dabs_map: make DABsPathToTerraform a true inverse of TerraformPathToDABs#5621

Open
denik wants to merge 9 commits into
mainfrom
denik/fix-dabs-to-terraform-path
Open

terraform_dabs_map: make DABsPathToTerraform a true inverse of TerraformPathToDABs#5621
denik wants to merge 9 commits into
mainfrom
denik/fix-dabs-to-terraform-path

Conversation

@denik

@denik denik commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Make DABsPathToTerraform the exact inverse of TerraformPathToDABs:

  • Prepend the TF wrapper segment (e.g. spec) only for fields that actually live under it, driven by a generated DABsToTerraformWrapperFields set. Root-level fields (status, timestamps, IDs) and unknowns now round-trip correctly.
  • Map the mlflow model's numeric ID across engines: model_id (direct) ↔ registered_model_id (Terraform). It's a state-computed field the codegen heuristics can't derive, so it's wired up via a small manualRenames table; registered_model_id is no longer classified Terraform-only.

A reference to registered_model_id now resolves on both the terraform and direct engines, covered by a new acceptance test.

Needed for #5399.

This pull request and its description were written by Isaac.

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

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

/bundle/ - needs approval

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

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

@denik denik temporarily deployed to test-trigger-is June 16, 2026 18:09 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 16, 2026 18:09 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 5f01604

Run: 27794078468

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 7 13 264 1012 4:46
💚​ aws windows 7 13 266 1010 6:48
💚​ aws-ucws linux 7 13 360 926 5:43
💚​ aws-ucws windows 7 13 362 924 7:27
💚​ azure linux 1 15 267 1010 4:52
💚​ azure windows 1 15 269 1008 6:47
💚​ azure-ucws linux 1 15 365 922 6:29
💚​ azure-ucws windows 1 15 367 920 7:35
💚​ gcp linux 1 15 263 1013 6:46
💚​ gcp windows 1 15 265 1011 7:58
20 interesting tests: 13 SKIP, 7 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 💚​R 💚​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 💚​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
Top 23 slowest tests (at least 2 minutes):
duration env testname
5:47 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:21 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:09 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:09 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:45 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:28 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:15 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:03 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:01 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:00 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:55 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:52 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:52 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:47 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:40 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:37 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:37 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:32 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:31 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:25 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:12 aws-ucws windows TestAccept
2:11 aws windows TestAccept
2:11 gcp windows TestAccept

@denik denik force-pushed the denik/fix-dabs-to-terraform-path branch from 4ca0527 to c64a6f3 Compare June 17, 2026 01:14
@denik denik temporarily deployed to test-trigger-is June 17, 2026 01:15 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 17, 2026 01:15 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 17, 2026 01:24 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 17, 2026 01:24 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 17, 2026 21:24 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 17, 2026 21:24 — with GitHub Actions Inactive
denik added 8 commits June 18, 2026 15:39
…level TF fields

For postgres groups with a spec wrapper, DABsPathToTerraform was
unconditionally prepending "spec" to all paths. Root-level TF fields
(name, status.*, create_time, project_id, etc.) live outside the wrapper
and must not receive the prefix.

Extend the codegen to emit DABsToTerraformRootFields: for each wrapper
group, the set of first-level TF field names that are at the resource
root. DABsPathToTerraform now only prepends the wrapper when the path's
first segment is absent from that set.

Remove noRoundtrip: true from the affected translate_test.go cases; add
new roundtrip cases for project_id and name.

Co-authored-by: Isaac
…st.go

All TerraformPathToDABs test cases now round-trip correctly through
DABsPathToTerraform, so the field and its guard are no longer needed.

Co-authored-by: Isaac
TerraformPathToDABs should be idempotent: a DABs-format path passed
through a second time must come back unchanged. Assert this for every
non-error test case.

Co-authored-by: Isaac
Rebase onto main picked up the new databricks_postgres_role resource;
regenerate generated.go to include it.

Co-authored-by: Isaac
Replace DABsToTerraformRootFields (exception-based: fields NOT under the
wrapper) with DABsToTerraformWrapperFields (positive: fields that ARE under
the wrapper). DABsPathToTerraform now prepends the wrapper only when the
first path segment appears in this set; unknown and root-level fields pass
through unchanged without requiring explicit enumeration.

Co-authored-by: Isaac
@denik denik force-pushed the denik/fix-dabs-to-terraform-path branch from 0fdd7cc to f2e6aee Compare June 18, 2026 22:41
@denik denik temporarily deployed to test-trigger-is June 18, 2026 22:41 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 18, 2026 22:41 — with GitHub Actions Inactive
The mlflow model's numeric ID is a state-computed field named model_id in the
direct engine and registered_model_id in Terraform. It lives in RemoteType, not
the config struct, and the two names are lexically unrelated, so the codegen's
heuristic matcher cannot derive the rename. Add a small manualRenames table so
the rename flows into both translation maps and registered_model_id is no longer
classified Terraform-only.

This lets a reference to registered_model_id resolve on both engines, covered by
a new acceptance test.

Co-authored-by: Isaac
@denik denik temporarily deployed to test-trigger-is June 18, 2026 22:48 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 18, 2026 22:48 — with GitHub Actions Inactive
@denik denik changed the title terraform_dabs_map: fix DABsPathToTerraform to skip wrapper for TF root-level fields terraform_dabs_map: make DABsPathToTerraform a true inverse of TerraformPathToDABs Jun 18, 2026
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