datastream: fix perpetual replacement of postgresql connection profiles using server_verification - #18606
Conversation
|
Googlers: For automatic test runs see go/terraform-auto-test-runs. @malhotrasagar2212, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 1a61020: Diff reportYour PR generated the following diffs in downstream repositories:
Test reportImportant Manual Verification Required VCR cannot automatically execute the following tests added in this PR. Please verify them manually: 🔴 TestAccDatastreamConnectionProfile_datastreamConnectionProfilePostgresqlSslconfigServerVerificationExample Analytics
Affected Service Packages
Step 1: Replaying Mode 🟢 All tests passed in Replaying mode! No Recording was needed. Caution Issues requiring attention before PR completion 🔴 Manual Verification Required: New tests were added that are skipped in presubmit tests. See the "Manual Verification Required" section at the top for details. Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer. View the replaying VCR build log @mvegter, @malhotrasagar2212 VCR tests complete for 1a61020! |
1a61020 to
a1166ab
Compare
|
Googlers: For automatic test runs see go/terraform-auto-test-runs. @SirGitsalot, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
…es using server_verification The API marks serverVerification.caCertificate as Input only and returns serverVerification as an empty object. The generated flatten nils the empty parent block before the field-level ignore_read applies, so every refresh empties the block in state and, the field being immutable, forces replacement of the connection profile and any dependent google_datastream_stream (full re-backfill). serverAndClientVerification already carries block-level ignore_read and is unaffected; this applies the same to serverVerification and adds a server_verification-only example whose post-apply plan check reproduces the bug.
a1166ab to
5a08672
Compare
|
I have added |
The Datastream API marks
serverVerification.caCertificateas "Input only" and returnsserverVerificationas an empty object on read. The generated flatten nils the empty parent block (len(original) == 0) before the field-levelignore_readcan apply, so every refresh empties the block in state and — the field being immutable — forces replacement of the connection profile and any dependentgoogle_datastream_stream, triggering a full re-backfill on every apply.serverAndClientVerificationalready carries block-levelignore_readand is unaffected; this applies the same toserverVerification. Also adds the previously missingserver_verification-only example, whose generated test's post-apply plan check reproduces the bug (fails without this fix, passes with it).Verified against the live API with a locally generated GA provider: with a healthy state, the released provider wipes the block on refresh and plans destroy/create; the patched provider preserves it and plans no changes.
Related to hashicorp/terraform-provider-google#17352 (same defect class for MySQL, where per-field workarounds suffice because
*Setmarker booleans keep the block non-empty; PostgreSQL's API has no marker fields, so the block-level form is required).Release Note Template for Downstream PRs (will be copied)