terraform_dabs_map: make DABsPathToTerraform a true inverse of TerraformPathToDABs#5621
Open
denik wants to merge 9 commits into
Open
terraform_dabs_map: make DABsPathToTerraform a true inverse of TerraformPathToDABs#5621denik wants to merge 9 commits into
denik wants to merge 9 commits into
Conversation
Contributor
Approval status: pending
|
Collaborator
Integration test reportCommit: 5f01604
20 interesting tests: 13 SKIP, 7 RECOVERED
Top 23 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
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.