terraform_dabs_map: fix DABsPathToTerraform to skip wrapper for TF root-level fields#5621
Open
denik wants to merge 7 commits into
Open
terraform_dabs_map: fix DABsPathToTerraform to skip wrapper for TF root-level fields#5621denik wants to merge 7 commits into
denik wants to merge 7 commits into
Conversation
Contributor
Waiting for approvalBased on git history, these people are best suited to review:
Eligible reviewers: Suggestions based on git history. See OWNERS for ownership rules. |
Collaborator
Integration test reportCommit: 0fdd7cc
24 interesting tests: 14 SKIP, 7 KNOWN, 2 FAIL, 1 flaky
Top 22 slowest tests (at least 2 minutes):
|
…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
4ca0527 to
c64a6f3
Compare
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
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
Fix
DABsPathToTerraformto only prepends when necessary (based on list of fields), making it the true inverse ofTerraformPathToDABsNeeded for #5399.
This pull request and its description were written by Isaac.