magic-modules icon indicating copy to clipboard operation
magic-modules copied to clipboard

Add support AlloyDB for PostgreSQL

Open DrFaust92 opened this issue 2 years ago • 50 comments

Part of #11754

If this PR is for Terraform, I acknowledge that I have:

  • [x] Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • [x] Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • [x] Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • [x] Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • [x] Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

google_alloydb_cluster
google_alloydb_instance

DrFaust92 avatar Jul 01 '22 07:07 DrFaust92

Hello! I am a robot who works on Magic Modules PRs.

I've detected that you're a community contributor. @melinath, a repository maintainer, has been assigned to assist you and help review your changes.

:question: First time contributing? Click here for more details

Your assigned reviewer will help review your code by:

  • Ensuring it's backwards compatible, covers common error cases, etc.
  • Summarizing the change into a user-facing changelog note.
  • Passes tests, either our "VCR" suite, a set of presubmit tests, or with manual test runs.

You can help make sure that review is quick by running local tests and ensuring they're passing in between each push you make to your PR's branch. Also, try to leave a comment with each push you make, as pushes generally don't generate emails.

If your reviewer doesn't get back to you within a week after your most recent change, please feel free to leave a comment on the issue asking them to take a look! In the absence of a dedicated review dashboard most maintainers manage their pending reviews through email, and those will sometimes get lost in their inbox.


modular-magician avatar Jul 01 '22 07:07 modular-magician

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 253 insertions(+)) Terraform Beta: Diff ( 8 files changed, 1537 insertions(+), 2 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-)) TF OiCS: Diff ( 4 files changed, 117 insertions(+))

modular-magician avatar Jul 01 '22 07:07 modular-magician

Tests analytics

Total tests: 2070 Passed tests 1840 Skipped tests: 226 Failed tests: 4

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests TestAccPrivatecaCertificateAuthority_subordinateCaActivatedByFirstPartyIssuerOnCreation|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccFirebaserulesRelease_BasicRelease|TestAccAlloydbCluster_alloydbClusterBasicExample

modular-magician avatar Jul 01 '22 08:07 modular-magician

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 311 insertions(+)) Terraform Beta: Diff ( 8 files changed, 1897 insertions(+), 2 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-)) TF OiCS: Diff ( 4 files changed, 117 insertions(+))

modular-magician avatar Jul 01 '22 08:07 modular-magician

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 317 insertions(+)) Terraform Beta: Diff ( 8 files changed, 1917 insertions(+), 2 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-)) TF OiCS: Diff ( 4 files changed, 120 insertions(+))

modular-magician avatar Jul 01 '22 09:07 modular-magician

Tests analytics

Total tests: 2070 Passed tests 1840 Skipped tests: 226 Failed tests: 4

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests TestAccFirebaserulesRelease_BasicRelease|TestAccAlloydbCluster_alloydbClusterBasicExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccPrivatecaCertificateAuthority_subordinateCaActivatedByFirstPartyIssuerOnCreation

modular-magician avatar Jul 01 '22 09:07 modular-magician

Tests passed during RECORDING mode: TestAccPrivatecaCertificateAuthority_subordinateCaActivatedByFirstPartyIssuerOnCreation[view] TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[view] TestAccFirebaserulesRelease_BasicRelease[view]

Tests failed during RECORDING mode: TestAccAlloydbCluster_alloydbClusterBasicExample[view]

Please fix these to complete your PR View the build log or the debug log for each test

modular-magician avatar Jul 01 '22 09:07 modular-magician

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 506 insertions(+)) Terraform Beta: Diff ( 12 files changed, 3024 insertions(+), 2 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-)) TF OiCS: Diff ( 8 files changed, 248 insertions(+))

modular-magician avatar Jul 01 '22 10:07 modular-magician

Tests analytics

Total tests: 2071 Passed tests 1841 Skipped tests: 226 Failed tests: 4

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests TestAccPrivatecaCertificateAuthority_subordinateCaActivatedByFirstPartyIssuerOnCreation|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccAlloydbInstance_alloydbInstanceBasicExample|TestAccAlloydbCluster_alloydbClusterBasicExample

modular-magician avatar Jul 01 '22 10:07 modular-magician

Tests passed during RECORDING mode: TestAccPrivatecaCertificateAuthority_subordinateCaActivatedByFirstPartyIssuerOnCreation[view] TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[view]

Tests failed during RECORDING mode: TestAccAlloydbCluster_alloydbClusterBasicExample[view] TestAccAlloydbInstance_alloydbInstanceBasicExample[view]

Please fix these to complete your PR View the build log or the debug log for each test

modular-magician avatar Jul 01 '22 10:07 modular-magician

I've enabled the AlloyDB API and am rerunning tests /gcbrun

melinath avatar Jul 01 '22 16:07 melinath

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 506 insertions(+)) Terraform Beta: Diff ( 12 files changed, 3024 insertions(+), 2 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-)) TF OiCS: Diff ( 8 files changed, 248 insertions(+))

modular-magician avatar Jul 01 '22 16:07 modular-magician

Thanks melinath, i was wondering why it fails as locally it passed 😢

DrFaust92 avatar Jul 01 '22 16:07 DrFaust92

Tests analytics

Total tests: 2074 Passed tests 1843 Skipped tests: 226 Failed tests: 5

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests TestAccFirebaserulesRelease_BasicRelease|TestAccAlloydbInstance_alloydbInstanceBasicExample|TestAccAlloydbCluster_alloydbClusterBasicExample|TestAccPrivatecaCertificateAuthority_subordinateCaActivatedByFirstPartyIssuerOnCreation|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample

modular-magician avatar Jul 01 '22 17:07 modular-magician

Tests passed during RECORDING mode: TestAccAlloydbCluster_alloydbClusterBasicExample[view] TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[view] TestAccPrivatecaCertificateAuthority_subordinateCaActivatedByFirstPartyIssuerOnCreation[view] TestAccFirebaserulesRelease_BasicRelease[view]

Tests failed during RECORDING mode: TestAccAlloydbInstance_alloydbInstanceBasicExample[view]

Please fix these to complete your PR View the build log or the debug log for each test

modular-magician avatar Jul 01 '22 17:07 modular-magician

Thanks melinath, ill address all of these. can you point me to a generated update example by any chance?

DrFaust92 avatar Jul 02 '22 07:07 DrFaust92

can you point me to a generated update example by any chance?

I should've clarified, sorry - I believe that update examples need to be handwritten. Here's an example: https://github.com/GoogleCloudPlatform/magic-modules/blob/a37b67b9a6abd47b53f56b95e2411ac2d3a4c755/mmv1/third_party/terraform/tests/resource_compute_disk_test.go.erb#L235

melinath avatar Jul 06 '22 16:07 melinath

It looks like downstream generation is currently failing with the following error:

RuntimeError: quantity_based_retention does not exist

This is probably due to my suggested changes and I'm not sure offhand what the underlying cause is. I'll mark this PR for review to remind myself I need to look into it when I get a chance.

melinath avatar Jul 06 '22 16:07 melinath

moving to draft

DrFaust92 avatar Jul 07 '22 08:07 DrFaust92

Reassigning this review since I won't be able to respond next week. Remaining work is https://github.com/GoogleCloudPlatform/magic-modules/pull/6208#discussion_r917047197

melinath avatar Jul 08 '22 20:07 melinath

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 520 insertions(+)) Terraform Beta: Diff ( 12 files changed, 3145 insertions(+), 2 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-)) TF OiCS: Diff ( 8 files changed, 247 insertions(+))

modular-magician avatar Jul 09 '22 07:07 modular-magician

Tests analytics

Total tests: 0 Passed tests 0 Skipped tests: 0 Failed tests: 0

Errors occurred during REPLAYING mode. Please fix them to complete your PR View the build log

modular-magician avatar Jul 09 '22 07:07 modular-magician

This is hitting an error due to the OperationWaitTime method signature requiring a project, and the call from AlloyDBInstance not using a project. I think this is actually a bug with magic modules, and I'm unsure how to correct it at the moment.

The autogenerated asynchronous functions are built per product, not per resource. The parent cluster resource requires a project in the base_url while the child instance resource implies the project from the parent reference. I've tried to find examples of this being remediated in other resources but could not find a similar scenario, so this may be the first time autogen_async has been used in a parent-child resource combination in mmv1.

c2thorn avatar Jul 11 '22 19:07 c2thorn

Thanks c2thorn, ill think how i can work around this. maybe i can split this PR and push cluster resource? (not a lot of value of just it though without instance)

DrFaust92 avatar Jul 11 '22 19:07 DrFaust92

alternatively i can revert the parent arg change and pass those as separate args as it worked before?

DrFaust92 avatar Jul 11 '22 19:07 DrFaust92

alternatively i can revert the parent arg change and pass those as separate args as it worked before?

yeah if it works well without it, then that would fix this particular issue. I haven't fully reviewed yet, but using the cluster in the base URL is essentially just a convenience here right?

c2thorn avatar Jul 11 '22 20:07 c2thorn

Yep it worked beside some other CR comments, I’ll tidy up the PR with that change.

On Mon, 11 Jul 2022 at 23:14 Cameron Thornton @.***> wrote:

alternatively i can revert the parent arg change and pass those as separate args as it worked before?

yeah if it works well without it, then that would fix this particular issue. I haven't fully reviewed yet, but using the cluster in the base URL is essentially just a convenience here right?

— Reply to this email directly, view it on GitHub https://github.com/GoogleCloudPlatform/magic-modules/pull/6208#issuecomment-1180823834, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIA2W7SMTAJ4SOEYDKVWDQTVTR6DJANCNFSM52LY5NLQ . You are receiving this because you authored the thread.Message ID: @.***>

DrFaust92 avatar Jul 11 '22 20:07 DrFaust92

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 5 files changed, 714 insertions(+)) Terraform Beta: Diff ( 14 files changed, 3400 insertions(+), 2 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-)) TF OiCS: Diff ( 8 files changed, 266 insertions(+))

modular-magician avatar Jul 16 '22 13:07 modular-magician

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 5 files changed, 552 insertions(+)) Terraform Beta: Diff ( 14 files changed, 3400 insertions(+), 2 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-)) TF OiCS: Diff ( 8 files changed, 266 insertions(+))

modular-magician avatar Jul 16 '22 14:07 modular-magician

Tests analytics

Total tests: 2112 Passed tests 1878 Skipped tests: 226 Failed tests: 8

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests TestAccPrivatecaCertificateAuthority_subordinateCaActivatedByFirstPartyIssuerOnCreation|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccFirebaserulesRelease_BasicRelease|TestAccComputeInstance_soleTenantNodeAffinities|TestAccAlloydbInstance_update|TestAccAlloydbInstance_alloydbInstanceBasicExample|TestAccAlloydbCluster_update|TestAccAlloydbCluster_alloydbClusterBasicExample

modular-magician avatar Jul 16 '22 14:07 modular-magician