terraform_dabs_map: make DABsPathToTerraform a true inverse of TerraformPathToDABs#5621
Merged
Conversation
Collaborator
Integration test reportCommit: 5b1f10c
22 interesting tests: 13 SKIP, 7 RECOVERED, 2 flaky
Top 20 slowest tests (at least 2 minutes):
|
4ca0527 to
c64a6f3
Compare
…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
…t property 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
Co-authored-by: Isaac
Co-authored-by: Isaac
0fdd7cc to
f2e6aee
Compare
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
Co-authored-by: Isaac
Co-authored-by: Isaac
|
|
||
| ### Bundles | ||
| * `bundle run` now prints the modern job run URL (`/jobs/<id>/runs/<id>`) so that non-admin users permitted to view the run are taken to the run instead of the workspace homepage. | ||
| * References to a registered model's `registered_model_id` now resolve under the direct engine, matching Terraform behavior ([#5621](https://github.com/databricks/cli/pull/5621)). |
Contributor
There was a problem hiding this comment.
what is registered_model_id? I don't see it here in our public documentation:
https://docs.databricks.com/api/workspace/registeredmodels/create
Contributor
Author
There was a problem hiding this comment.
This is the field that DABs on terraform supports. So we translate it for compat between terraform & direct engine.
andrewnester
approved these changes
Jun 23, 2026
denik
added a commit
that referenced
this pull request
Jun 23, 2026
main's DABsToTerraformRenameMap now maps models.model_id -> registered_model_id (PR #5621), so the manual tfStateFieldAliases map and the alias-fallback branch in LookupTFField are redundant. LookupTFField now translates once and navigates. Co-authored-by: Isaac
denik
added a commit
that referenced
this pull request
Jun 24, 2026
main's DABsToTerraformRenameMap now maps models.model_id -> registered_model_id (PR #5621), so the manual tfStateFieldAliases map and the alias-fallback branch in LookupTFField are redundant. LookupTFField now translates once and navigates. Co-authored-by: Isaac
denik
added a commit
that referenced
this pull request
Jun 24, 2026
main's DABsToTerraformRenameMap now maps models.model_id -> registered_model_id (PR #5621), so the manual tfStateFieldAliases map and the alias-fallback branch in LookupTFField are redundant. LookupTFField now translates once and navigates. Co-authored-by: Isaac
deco-sdk-tagging Bot
added a commit
that referenced
this pull request
Jun 24, 2026
## Release v1.5.0 ### CLI * `workspace export-dir` no longer aborts when a workspace object's name is not a legal local filename (e.g. a notebook named `New Notebook 2026-05-04 13:54:24` whose `:` is illegal on Windows). Such files are now exported under a sanitized name with a warning and the export completes ([#5171](#5171)). * `ssh connect` now opens an interactive `bash` login shell by default instead of the compute image's default `/bin/sh`, falling back gracefully when `bash` is unavailable. Passing an explicit remote command (`-- <cmd>`) is unaffected ([#5687](#5687)). * `ssh connect` interactive sessions now start in the user's workspace home folder (`/Workspace/Users/<email>`) instead of the OS home directory, falling back to the OS home when that folder is unavailable ([#5688](#5688)). ### Bundles * Add documentation for the common bundle resource fields `permissions`, `lifecycle`, and `grants` in the JSON schema, so they surface in editor completions and the docs. * `bundle run` now prints the modern job run URL (`/jobs/<id>/runs/<id>`) so that non-admin users permitted to view the run are taken to the run instead of the workspace homepage. * References to a registered model's `registered_model_id` now resolve under the direct engine, matching Terraform behavior ([#5621](#5621)). * Fix missing field descriptions in the bundle JSON schema for fields whose upstream API docs arrived after the field was first annotated (e.g. `vector_search_endpoints.*.target_qps`); stale placeholder markers no longer hide them ([#5588](#5588)). * Fix `bundle deploy --plan` dropping a `postgres_role`'s `role_id`, which caused the role to be recreated on the next deploy ([#5672](#5672)). * direct: Fix spurious cluster recreate when `apply_policy_default_values: true` is set ([#5693](#5693)). * direct: New 'deployment migrate' implementation that parses terraform state instead of fetching resources state from the backend ([#5399](#5399)). ### Dependency updates * Bump `github.com/databricks/databricks-sdk-go` from v0.141.0 to v0.147.0 ([#5636](#5636)). * Bump Terraform provider from v1.117.0 to v1.118.0 ([#5637](#5637)).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make
DABsPathToTerraformthe exact inverse ofTerraformPathToDABs:spec) only for fields that actually live under it, driven by a generatedDABsToTerraformWrapperFieldsset. Root-level fields (status, timestamps, IDs) and unknowns now round-trip correctly.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 smallmanualRenamestable;registered_model_idis no longer classified Terraform-only.A reference to
registered_model_idnow 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.