Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support SQL Server Switchover (after resolving email rebase conflicts) #12241

Merged

Conversation

Philip-Jonany
Copy link
Contributor

@Philip-Jonany Philip-Jonany commented Nov 4, 2024

Support SQL Server Switchover through terraform
The full design doc can be found in go/sqlserver-switchover-terraform-proposal (Googler-only)

The API changes are rolled out, and my manual testing passes without causing a permadiff

compute: added `replica_names` field to `sql_database_instance` resource

@github-actions github-actions bot requested a review from melinath November 4, 2024 23:54
Copy link

github-actions bot commented Nov 4, 2024

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@slevenick, 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.

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Nov 4, 2024
@Philip-Jonany
Copy link
Contributor Author

This pull request was copied over from #11850, which faced issues rebasing to update one commit's email address

@modular-magician modular-magician added service/sqladmin-cp and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Nov 5, 2024
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 4 files changed, 495 insertions(+), 18 deletions(-))
google-beta provider: Diff ( 4 files changed, 495 insertions(+), 18 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field settings.edition default value changed from to ENTERPRISE on google_sql_database_instance - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_sql_database_instance (149 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_sql_database_instance" "primary" {
  replica_configuration {
    ca_certificate     = # value needed
    client_certificate = # value needed
    client_key         = # value needed
    dump_file_path     = # value needed
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 102
Passed tests: 0
Skipped tests: 16
Affected tests: 86

Click here to see the affected service packages
  • sql

Action taken

Found 86 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDataSourceGoogleSQLCaCerts_basic
  • TestAccDataSourceGoogleSqlTiers_basic
  • TestAccDataSourceSqlDatabaseInstanceLatestRecoveryTime_basic
  • TestAccDataSourceSqlDatabaseInstance_basic
  • TestAccDataSourceSqlDatabaseInstances_basic
  • TestAccDataSourceSqlDatabaseInstances_databaseVersionFilter
  • TestAccDataSourceSqlDatabaseInstances_regionFilter
  • TestAccDataSourceSqlDatabaseInstances_tierFilter
  • TestAccDataSourceSqlDatabase_basic
  • TestAccDataSourceSqlDatabases_basic
  • TestAccSQLDatabaseInstance_DefaultEdition
  • TestAccSQLDatabaseInstance_DenyMaintenancePeriod
  • TestAccSQLDatabaseInstance_sqlMysqlDataCacheConfig
  • TestAccSQLDatabaseInstance_sqlPostgresDataCacheConfig
  • TestAccSQLDatabase_sqlDatabaseBasicExample
  • TestAccSQLDatabase_sqlDatabaseDeletionPolicyExample
  • TestAccSQLSourceRepresentationInstance_sqlSourceRepresentationInstanceBasicExample
  • TestAccSQLSourceRepresentationInstance_sqlSourceRepresentationInstancePostgresExample
  • TestAccSqlClientCert_mysql
  • TestAccSqlClientCert_postgres
  • TestAccSqlDatabaseInstance_BackupRetention
  • TestAccSqlDatabaseInstance_Edition
  • TestAccSqlDatabaseInstance_EnableGoogleDataplexIntegration
  • TestAccSqlDatabaseInstance_EnableGoogleMlIntegration
  • TestAccSqlDatabaseInstance_Mysql_Edition_Upgrade
  • TestAccSqlDatabaseInstance_PointInTimeRecoveryEnabled
  • TestAccSqlDatabaseInstance_PointInTimeRecoveryEnabledForSqlServer
  • TestAccSqlDatabaseInstance_Postgres_Edition_Upgrade
  • TestAccSqlDatabaseInstance_ReplicaPromoteFailedWithMasterInstanceNameAndReplicaConfigurationPresent
  • TestAccSqlDatabaseInstance_ReplicaPromoteFailedWithMasterInstanceNamePresent
  • TestAccSqlDatabaseInstance_ReplicaPromoteFailedWithReplicaConfigurationPresent
  • TestAccSqlDatabaseInstance_ReplicaPromoteSkippedWithNoMasterInstanceNameAndNoReplicaConfigurationPresent
  • TestAccSqlDatabaseInstance_ReplicaPromoteSuccessful
  • TestAccSqlDatabaseInstance_Smt
  • TestAccSqlDatabaseInstance_SqlServerAuditOptionalBucket
  • TestAccSqlDatabaseInstance_SqlServerTimezoneUpdate
  • TestAccSqlDatabaseInstance_SwitchoverSuccess
  • TestAccSqlDatabaseInstance_Timezone
  • TestAccSqlDatabaseInstance_activationPolicy
  • TestAccSqlDatabaseInstance_authNets
  • TestAccSqlDatabaseInstance_basicInstance_thenPSCEnabled
  • TestAccSqlDatabaseInstance_basicMSSQL
  • TestAccSqlDatabaseInstance_basicSecondGen
  • TestAccSqlDatabaseInstance_basic_with_user_labels
  • TestAccSqlDatabaseInstance_deleteDefaultUserBeforeSubsequentApiCalls
  • TestAccSqlDatabaseInstance_diskspecs
  • TestAccSqlDatabaseInstance_dontDeleteDefaultUserOnReplica
  • TestAccSqlDatabaseInstance_encryptionKey
  • TestAccSqlDatabaseInstance_encryptionKey_replicaInDifferentRegion
  • TestAccSqlDatabaseInstance_highAvailability
  • TestAccSqlDatabaseInstance_insights
  • TestAccSqlDatabaseInstance_maintenance
  • TestAccSqlDatabaseInstance_maintenanceVersion
  • TestAccSqlDatabaseInstance_maintenance_update_track_week5
  • TestAccSqlDatabaseInstance_multipleOperations
  • TestAccSqlDatabaseInstance_replica
  • TestAccSqlDatabaseInstance_rootPasswordShouldBeUpdatable
  • TestAccSqlDatabaseInstance_settingsDowngrade
  • TestAccSqlDatabaseInstance_settings_basic
  • TestAccSqlDatabaseInstance_settings_checkServiceNetworking
  • TestAccSqlDatabaseInstance_settings_deletionProtection
  • TestAccSqlDatabaseInstance_settings_deletionProtectionEnabled
  • TestAccSqlDatabaseInstance_settings_secondary
  • TestAccSqlDatabaseInstance_settings_upgrade
  • TestAccSqlDatabaseInstance_slave
  • TestAccSqlDatabaseInstance_sqlMysqlInstancePvpExample
  • TestAccSqlDatabaseInstance_updateDifferentFlagOrder
  • TestAccSqlDatabaseInstance_updateReadReplicaWithBinaryLogEnabled
  • TestAccSqlDatabaseInstance_updateSslOptionsForPostgreSQL
  • TestAccSqlDatabaseInstance_useCasBasedServerCa
  • TestAccSqlDatabaseInstance_useInternalCaByDefault
  • TestAccSqlDatabaseInstance_withPSCEnabled_thenAddAllowedConsumerProjects_thenRemoveAllowedConsumerProject
  • TestAccSqlDatabaseInstance_withPSCEnabled_withAllowedConsumerProjects
  • TestAccSqlDatabaseInstance_withPSCEnabled_withEmptyAllowedConsumerProjects
  • TestAccSqlDatabaseInstance_withPSCEnabled_withIpV4Enabled
  • TestAccSqlDatabaseInstance_withPSCEnabled_withoutAllowedConsumerProjects
  • TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange
  • TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRangeClone
  • TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRangeReplica
  • TestAccSqlDatabaseInstance_withPrivateNetwork_withoutAllocatedIpRange
  • TestAccSqlDatabase_basic
  • TestAccSqlDatabase_instanceWithActivationPolicy
  • TestAccSqlDatabase_update
  • TestAccSqlUser_postgres
  • TestAccSqlUser_postgresAbandon
  • TestAccSqlUser_postgresIAM

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccDataSourceGoogleSQLCaCerts_basic [Error message] [Debug log]
TestAccDataSourceGoogleSqlTiers_basic [Error message] [Debug log]
TestAccDataSourceSqlDatabaseInstanceLatestRecoveryTime_basic [Error message] [Debug log]
TestAccDataSourceSqlDatabaseInstance_basic [Error message] [Debug log]
TestAccDataSourceSqlDatabaseInstances_basic [Error message] [Debug log]
TestAccDataSourceSqlDatabaseInstances_databaseVersionFilter [Error message] [Debug log]
TestAccDataSourceSqlDatabaseInstances_regionFilter [Error message] [Debug log]
TestAccDataSourceSqlDatabaseInstances_tierFilter [Error message] [Debug log]
TestAccDataSourceSqlDatabase_basic [Error message] [Debug log]
TestAccDataSourceSqlDatabases_basic [Error message] [Debug log]
TestAccSQLDatabaseInstance_DefaultEdition [Error message] [Debug log]
TestAccSQLDatabaseInstance_DenyMaintenancePeriod [Error message] [Debug log]
TestAccSQLDatabaseInstance_sqlMysqlDataCacheConfig [Error message] [Debug log]
TestAccSQLDatabaseInstance_sqlPostgresDataCacheConfig [Error message] [Debug log]
TestAccSQLDatabase_sqlDatabaseBasicExample [Error message] [Debug log]
TestAccSQLDatabase_sqlDatabaseDeletionPolicyExample [Error message] [Debug log]
TestAccSQLSourceRepresentationInstance_sqlSourceRepresentationInstanceBasicExample [Error message] [Debug log]
TestAccSQLSourceRepresentationInstance_sqlSourceRepresentationInstancePostgresExample [Error message] [Debug log]
TestAccSqlClientCert_mysql [Error message] [Debug log]
TestAccSqlClientCert_postgres [Error message] [Debug log]
TestAccSqlDatabaseInstance_BackupRetention [Error message] [Debug log]
TestAccSqlDatabaseInstance_Edition [Error message] [Debug log]
TestAccSqlDatabaseInstance_EnableGoogleDataplexIntegration [Error message] [Debug log]
TestAccSqlDatabaseInstance_EnableGoogleMlIntegration [Error message] [Debug log]
TestAccSqlDatabaseInstance_Mysql_Edition_Upgrade [Error message] [Debug log]
TestAccSqlDatabaseInstance_PointInTimeRecoveryEnabled [Error message] [Debug log]
TestAccSqlDatabaseInstance_PointInTimeRecoveryEnabledForSqlServer [Error message] [Debug log]
TestAccSqlDatabaseInstance_Postgres_Edition_Upgrade [Error message] [Debug log]
TestAccSqlDatabaseInstance_ReplicaPromoteFailedWithMasterInstanceNameAndReplicaConfigurationPresent [Error message] [Debug log]
TestAccSqlDatabaseInstance_ReplicaPromoteFailedWithMasterInstanceNamePresent [Error message] [Debug log]
TestAccSqlDatabaseInstance_ReplicaPromoteFailedWithReplicaConfigurationPresent [Error message] [Debug log]
TestAccSqlDatabaseInstance_ReplicaPromoteSkippedWithNoMasterInstanceNameAndNoReplicaConfigurationPresent [Error message] [Debug log]
TestAccSqlDatabaseInstance_ReplicaPromoteSuccessful [Error message] [Debug log]
TestAccSqlDatabaseInstance_Smt [Error message] [Debug log]
TestAccSqlDatabaseInstance_SqlServerAuditOptionalBucket [Error message] [Debug log]
TestAccSqlDatabaseInstance_SqlServerTimezoneUpdate [Error message] [Debug log]
TestAccSqlDatabaseInstance_SwitchoverSuccess [Error message] [Debug log]
TestAccSqlDatabaseInstance_Timezone [Error message] [Debug log]
TestAccSqlDatabaseInstance_activationPolicy [Error message] [Debug log]
TestAccSqlDatabaseInstance_authNets [Error message] [Debug log]
TestAccSqlDatabaseInstance_basicInstance_thenPSCEnabled [Error message] [Debug log]
TestAccSqlDatabaseInstance_basicMSSQL [Error message] [Debug log]
TestAccSqlDatabaseInstance_basicSecondGen [Error message] [Debug log]
TestAccSqlDatabaseInstance_basic_with_user_labels [Error message] [Debug log]
TestAccSqlDatabaseInstance_deleteDefaultUserBeforeSubsequentApiCalls [Error message] [Debug log]
TestAccSqlDatabaseInstance_diskspecs [Error message] [Debug log]
TestAccSqlDatabaseInstance_dontDeleteDefaultUserOnReplica [Error message] [Debug log]
TestAccSqlDatabaseInstance_encryptionKey [Error message] [Debug log]
TestAccSqlDatabaseInstance_encryptionKey_replicaInDifferentRegion [Error message] [Debug log]
TestAccSqlDatabaseInstance_highAvailability [Error message] [Debug log]
TestAccSqlDatabaseInstance_insights [Error message] [Debug log]
TestAccSqlDatabaseInstance_maintenance [Error message] [Debug log]
TestAccSqlDatabaseInstance_maintenanceVersion [Error message] [Debug log]
TestAccSqlDatabaseInstance_maintenance_update_track_week5 [Error message] [Debug log]
TestAccSqlDatabaseInstance_multipleOperations [Error message] [Debug log]
TestAccSqlDatabaseInstance_replica [Error message] [Debug log]
TestAccSqlDatabaseInstance_rootPasswordShouldBeUpdatable [Error message] [Debug log]
TestAccSqlDatabaseInstance_settingsDowngrade [Error message] [Debug log]
TestAccSqlDatabaseInstance_settings_basic [Error message] [Debug log]
TestAccSqlDatabaseInstance_settings_checkServiceNetworking [Error message] [Debug log]
TestAccSqlDatabaseInstance_settings_deletionProtection [Error message] [Debug log]
TestAccSqlDatabaseInstance_settings_deletionProtectionEnabled [Error message] [Debug log]
TestAccSqlDatabaseInstance_settings_secondary [Error message] [Debug log]
TestAccSqlDatabaseInstance_settings_upgrade [Error message] [Debug log]
TestAccSqlDatabaseInstance_slave [Error message] [Debug log]
TestAccSqlDatabaseInstance_sqlMysqlInstancePvpExample [Error message] [Debug log]
TestAccSqlDatabaseInstance_updateDifferentFlagOrder [Error message] [Debug log]
TestAccSqlDatabaseInstance_updateReadReplicaWithBinaryLogEnabled [Error message] [Debug log]
TestAccSqlDatabaseInstance_updateSslOptionsForPostgreSQL [Error message] [Debug log]
TestAccSqlDatabaseInstance_useCasBasedServerCa [Error message] [Debug log]
TestAccSqlDatabaseInstance_useInternalCaByDefault [Error message] [Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_thenAddAllowedConsumerProjects_thenRemoveAllowedConsumerProject [Error message] [Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_withAllowedConsumerProjects [Error message] [Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_withEmptyAllowedConsumerProjects [Error message] [Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_withIpV4Enabled [Error message] [Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_withoutAllowedConsumerProjects [Error message] [Debug log]
TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange [Error message] [Debug log]
TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRangeClone [Error message] [Debug log]
TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRangeReplica [Error message] [Debug log]
TestAccSqlDatabaseInstance_withPrivateNetwork_withoutAllocatedIpRange [Error message] [Debug log]
TestAccSqlDatabase_basic [Error message] [Debug log]
TestAccSqlDatabase_instanceWithActivationPolicy [Error message] [Debug log]
TestAccSqlDatabase_update [Error message] [Debug log]
TestAccSqlUser_postgres [Error message] [Debug log]
TestAccSqlUser_postgresAbandon [Error message] [Debug log]
TestAccSqlUser_postgresIAM [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@@ -178,6 +186,7 @@ func ResourceSqlDatabaseInstance() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Computed: true,
Default: "ENTERPRISE",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this must be removed. Was this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@github-actions github-actions bot requested a review from slevenick November 5, 2024 17:14
@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Nov 5, 2024
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 4 files changed, 494 insertions(+), 18 deletions(-))
google-beta provider: Diff ( 4 files changed, 494 insertions(+), 18 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_sql_database_instance (149 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_sql_database_instance" "primary" {
  replica_configuration {
    ca_certificate     = # value needed
    client_certificate = # value needed
    client_key         = # value needed
    dump_file_path     = # value needed
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 102
Passed tests: 85
Skipped tests: 16
Affected tests: 1

Click here to see the affected service packages
  • sql

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccSqlDatabaseInstance_SwitchoverSuccess

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccSqlDatabaseInstance_SwitchoverSuccess [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

@melinath melinath removed their request for review November 5, 2024 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants