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

Support Self Service Maintenance feature

Open 2tricpony opened this issue 2 years ago • 56 comments

Support Self Service Maintenance feature. This adds support for 2 API fields - maintenance_version and available_maintenance_version. Fixes https://github.com/hashicorp/terraform-provider-google/issues/11881

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).
  • [] 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)

sql: added `maintenance_version` and `available_maintenance_versions` fields to `google_sql_database_instance` resource

2tricpony avatar Jun 14 '22 21:06 2tricpony

Oops! It looks like you're using an unknown release-note type in your changelog entries:

  • sql: added maintenance_version and 'available_maintenance_versions' fields in google_sql_database_instance

Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

modular-magician avatar Jun 14 '22 21:06 modular-magician

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

I've detected that you're a community contributor. @shuyama1, 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 Jun 14 '22 21:06 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, 42 insertions(+), 3 deletions(-)) Terraform Beta: Diff ( 2 files changed, 42 insertions(+), 3 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Jun 14 '22 21:06 modular-magician

Tests analytics

Total tests: 2052 Passed tests 1823 Skipped tests: 226 Failed tests: 3

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests TestAccContainerCluster_withConfidentialNodes|TestAccContainerCluster_withAddons|TestAccSqlUser_mysqlDisabled

modular-magician avatar Jun 14 '22 22:06 modular-magician

Tests passed during RECORDING mode: TestAccSqlUser_mysqlDisabled[view]

Tests failed during RECORDING mode: TestAccContainerCluster_withAddons[view] TestAccContainerCluster_withConfidentialNodes[view]

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

modular-magician avatar Jun 15 '22 00:06 modular-magician

Question: Is available_maintenance_versions an output-only field while maintenance_version is not? Just want to make sure if I understand correctly. Many thanks!

shuyama1 avatar Jun 15 '22 20:06 shuyama1

That is correct! availabe_maintenance_versions can never be updated. maintenance_version field can be updated to any of versions specified in the available_maintenance_versions field.

2tricpony avatar Jun 20 '22 16:06 2tricpony

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

Diff report:

Terraform GA: Diff ( 3 files changed, 75 insertions(+), 3 deletions(-)) Terraform Beta: Diff ( 3 files changed, 75 insertions(+), 3 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

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

Tests analytics

Total tests: 2112 Passed tests 1879 Skipped tests: 226 Failed tests: 7

Action taken

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

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

Tests passed during RECORDING mode: TestAccSqlDatabaseInstance_basicMSSQL[view] TestAccSqlDatabaseInstance_SqlServerAuditConfig[view] TestAccSqlDatabaseInstance_maintenanceVersionWithOldVersion_suppressConfig[view] TestAccFirebaserulesRelease_BasicRelease[view]

Tests failed during RECORDING mode: TestAccComputeInstance_soleTenantNodeAffinities[view] TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[view] TestAccPrivatecaCertificateAuthority_subordinateCaActivatedByFirstPartyIssuerOnCreation[view]

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

modular-magician avatar Jul 19 '22 23:07 modular-magician

Hi shuyama1,

I have addressed the changes that were requested. Please take another look.

2tricpony avatar Jul 20 '22 17:07 2tricpony

@2tricpony Thanks for making the update! Sorry for the delay. I'll start reviewing the PR.

shuyama1 avatar Jul 26 '22 16:07 shuyama1

Gentle ping on this. :)

2tricpony avatar Aug 08 '22 17:08 2tricpony

@2tricpony Sorry, this fell off my radar. Thanks for the ping!

shuyama1 avatar Aug 09 '22 16:08 shuyama1

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

Diff report:

Terraform GA: Diff ( 3 files changed, 75 insertions(+), 3 deletions(-)) Terraform Beta: Diff ( 3 files changed, 75 insertions(+), 3 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Aug 09 '22 17:08 modular-magician

Tests analytics

Total tests: 2129 Passed tests 1893 Skipped tests: 227 Failed tests: 9

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests TestAccFirebaserulesRelease_BasicRelease|TestAccComputeInstance_networkPerformanceConfig|TestAccComputeInstance_soleTenantNodeAffinities|TestAccComputeGlobalForwardingRule_internalLoadBalancing|TestAccCloudRunService_cloudRunServiceStaticOutboundExample|TestAccCloudfunctions2function_cloudfunctions2BasicGcsExample|TestAccCloudFunctions2Function_fullUpdate|TestAccCloudfunctions2function_cloudfunctions2BasicAuditlogsExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample

modular-magician avatar Aug 09 '22 17:08 modular-magician

Tests passed during RECORDING mode: TestAccFirebaserulesRelease_BasicRelease[view] TestAccCloudfunctions2function_cloudfunctions2BasicGcsExample[view] TestAccCloudFunctions2Function_fullUpdate[view] TestAccCloudfunctions2function_cloudfunctions2BasicAuditlogsExample[view] TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[view]

Tests failed during RECORDING mode: TestAccComputeInstance_networkPerformanceConfig[view] TestAccComputeInstance_soleTenantNodeAffinities[view] TestAccComputeGlobalForwardingRule_internalLoadBalancing[view] TestAccCloudRunService_cloudRunServiceStaticOutboundExample[view]

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

modular-magician avatar Aug 09 '22 17:08 modular-magician

Thanks for your review! Please take another look @shuyama1

2tricpony avatar Aug 10 '22 23:08 2tricpony

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

Diff report:

Terraform GA: Diff ( 3 files changed, 97 insertions(+), 3 deletions(-)) Terraform Beta: Diff ( 3 files changed, 97 insertions(+), 3 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Aug 10 '22 23:08 modular-magician

Tests analytics

Total tests: 2129 Passed tests 1889 Skipped tests: 227 Failed tests: 13

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests TestAccComputeInstance_networkPerformanceConfig|TestAccComputeInstance_soleTenantNodeAffinities|TestAccComputeGlobalForwardingRule_internalLoadBalancing|TestAccCloudfunctions2function_cloudfunctions2BasicAuditlogsExample|TestAccCloudfunctions2function_cloudfunctions2BasicGcsExample|TestAccCloudFunctions2Function_fullUpdate|TestAccCloudRunService_cloudRunServiceStaticOutboundExample|TestAccBigtableAppProfile_bigtableAppProfileMulticlusterExample|TestAccBigtableAppProfile_bigtableAppProfileSingleclusterExample|TestAccBigtableAppProfile_bigtableAppProfileAnyclusterExample|TestAccBigQueryDataTable_bigtable|TestAccSqlDatabaseInstance_maintenanceVersion_suppressDiff|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample

modular-magician avatar Aug 10 '22 23:08 modular-magician

Tests passed during RECORDING mode: TestAccCloudfunctions2function_cloudfunctions2BasicAuditlogsExample[view] TestAccCloudfunctions2function_cloudfunctions2BasicGcsExample[view] TestAccCloudFunctions2Function_fullUpdate[view] TestAccBigtableAppProfile_bigtableAppProfileMulticlusterExample[view] TestAccBigtableAppProfile_bigtableAppProfileSingleclusterExample[view] TestAccBigtableAppProfile_bigtableAppProfileAnyclusterExample[view] TestAccBigQueryDataTable_bigtable[view] TestAccSqlDatabaseInstance_maintenanceVersion_suppressDiff[view] TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[view]

Tests failed during RECORDING mode: TestAccComputeInstance_networkPerformanceConfig[view] TestAccComputeInstance_soleTenantNodeAffinities[view] TestAccComputeGlobalForwardingRule_internalLoadBalancing[view] TestAccCloudRunService_cloudRunServiceStaticOutboundExample[view]

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

modular-magician avatar Aug 11 '22 00:08 modular-magician

I think I have addressed all the concerns. Thanks for reviewing this patiently!

2tricpony avatar Aug 17 '22 18:08 2tricpony

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

Diff report:

Terraform GA: Diff ( 3 files changed, 129 insertions(+), 3 deletions(-)) Terraform Beta: Diff ( 3 files changed, 129 insertions(+), 3 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Aug 22 '22 21:08 modular-magician

Addressed comments. Please take another look!

2tricpony avatar Aug 22 '22 22:08 2tricpony

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

Diff report:

Terraform GA: Diff ( 3 files changed, 125 insertions(+), 3 deletions(-)) Terraform Beta: Diff ( 3 files changed, 125 insertions(+), 3 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Aug 22 '22 22:08 modular-magician

Tests analytics

Total tests: 2141 Passed tests 1892 Skipped tests: 228 Failed tests: 21

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccComputeInstance_networkPerformanceConfig|TestAccComputeInstance_soleTenantNodeAffinities|TestAccComputeGlobalForwardingRule_internalLoadBalancing|TestAccCloudfunctions2function_cloudfunctions2BasicGcsExample|TestAccCloudfunctions2function_cloudfunctions2BasicAuditlogsExample|TestAccBigtableAppProfile_bigtableAppProfileMulticlusterExample|TestAccCloudFunctions2Function_fullUpdate|TestAccBigtableAppProfile_bigtableAppProfileAnyclusterExample|TestAccCloudRunService_cloudRunServiceStaticOutboundExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccSqlDatabaseInstance_settings_upgrade|TestAccSqlDatabaseInstance_maintenanceVersion|TestAccSqlDatabaseInstance_settings_deletionProtection|TestAccSqlDatabaseInstance_basicMSSQL|TestAccSqlDatabaseInstance_PointInTimeRecoveryEnabled|TestAccSqlUser_mysqlDisabled|TestAccSqlDatabaseInstance_basic_with_user_labels|TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange|TestAccSqlDatabaseInstance_authNets|TestAccSqlDatabaseInstance_SqlServerAuditConfig|TestAccSqlDatabaseInstance_mysqlMajorVersionUpgrade

modular-magician avatar Aug 22 '22 23:08 modular-magician

Tests passed during RECORDING mode: TestAccCloudfunctions2function_cloudfunctions2BasicGcsExample[view] TestAccCloudfunctions2function_cloudfunctions2BasicAuditlogsExample[view] TestAccBigtableAppProfile_bigtableAppProfileMulticlusterExample[view] TestAccCloudFunctions2Function_fullUpdate[view] TestAccBigtableAppProfile_bigtableAppProfileAnyclusterExample[view] TestAccSqlDatabaseInstance_settings_upgrade[view] TestAccSqlDatabaseInstance_maintenanceVersion[view] TestAccSqlDatabaseInstance_settings_deletionProtection[view] TestAccSqlDatabaseInstance_basicMSSQL[view] TestAccSqlDatabaseInstance_PointInTimeRecoveryEnabled[view] TestAccSqlUser_mysqlDisabled[view] TestAccSqlDatabaseInstance_basic_with_user_labels[view] TestAccSqlDatabaseInstance_authNets[view]

Tests failed during RECORDING mode: TestAccComputeInstance_networkPerformanceConfig[view] TestAccComputeInstance_soleTenantNodeAffinities[view] TestAccComputeGlobalForwardingRule_internalLoadBalancing[view] TestAccCloudRunService_cloudRunServiceStaticOutboundExample[view] TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[view] TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange[view] TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRangeClone[view] TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRangeReplica[view] TestAccSqlDatabaseInstance_SqlServerAuditConfig[view] TestAccSqlDatabaseInstance_mysqlMajorVersionUpgrade[view]

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

modular-magician avatar Aug 23 '22 00:08 modular-magician

Updated code to handle maintenance version updates with separate patch call.

2tricpony avatar Aug 24 '22 18:08 2tricpony

PTAL

2tricpony avatar Aug 29 '22 15:08 2tricpony

/gcbrun

shuyama1 avatar Aug 29 '22 15:08 shuyama1