Allow ENTERPRISE_PLUS as default Edition for POSTGRES_16
Current default: ENTERPRISE for settings.edition is not consistent with the API which treats EDITION_UNSPECIFIED as the default (refer link) when customer doesn't provide any. With PostgreSQL version 16, the default Edition will be ENTERPRISE_PLUS as documented in the PostgreSQL June 07, 2024 release notes. Thus, unset the default edition so that it can instead be computed in the API, allowing the API to use ENTERPRISE_PLUS as the default for POSTGRES_16.
b/338258663
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] 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] Generated Terraform providers, and ran
make testandmake lintin the generated providers to ensure it passes unit and linter tests. - [X] Ran relevant acceptance tests using my own Google Cloud project and credentials (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: Unset the default `edition` so that it can instead be computed in the API, allowing the API to use `ENTERPRISE_PLUS` as the default for POSTGRES_16.
Hello! I am a robot. Tests will require approval from a repository maintainer to run.
@roaks3, 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.
@roaks3 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.
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 ( 2 files changed, 48 insertions(+), 17 deletions(-))
google-beta provider: Diff ( 2 files changed, 48 insertions(+), 17 deletions(-))
Breaking Change(s) Detected
The following breaking change(s) were detected within your pull request.
- Field
settings.editiondefault value changed from ENTERPRISE toon 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.
Tests analytics
Total tests: 95
Passed tests: 7
Skipped tests: 14
Affected tests: 74
Click here to see the affected service packages
- sql
Action taken
Found 74 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|TestAccDataSourceSqlDatabaseInstanceLatestRecoveryTime_basic|TestAccDataSourceSqlDatabaseInstance_basic|TestAccDataSourceSqlDatabaseInstances_basic|TestAccDataSourceSqlDatabaseInstances_databaseVersionFilter|TestAccDataSourceSqlDatabaseInstances_regionFilter|TestAccDataSourceSqlDatabaseInstances_tierFilter|TestAccDataSourceSqlDatabase_basic|TestAccDataSourceSqlDatabases_basic|TestAccSQLDatabaseInstance_DefaultEdition|TestAccSQLDatabaseInstance_DenyMaintenancePeriod|TestAccSQLDatabase_sqlDatabaseBasicExample|TestAccSQLDatabase_sqlDatabaseDeletionPolicyExample|TestAccSqlClientCert_mysql|TestAccSqlClientCert_postgres|TestAccSqlDatabaseInstance_BackupRetention|TestAccSqlDatabaseInstance_Edition|TestAccSqlDatabaseInstance_Edition_Downgrade|TestAccSqlDatabaseInstance_EnableGoogleMlIntegration|TestAccSqlDatabaseInstance_Mysql_Edition_Upgrade|TestAccSqlDatabaseInstance_PointInTimeRecoveryEnabled|TestAccSqlDatabaseInstance_PointInTimeRecoveryEnabledForSqlServer|TestAccSqlDatabaseInstance_ReplicaPromoteFailedWithMasterInstanceNameAndReplicaConfigurationPresent|TestAccSqlDatabaseInstance_ReplicaPromoteFailedWithMasterInstanceNamePresent|TestAccSqlDatabaseInstance_ReplicaPromoteFailedWithReplicaConfigurationPresent|TestAccSqlDatabaseInstance_ReplicaPromoteSkippedWithNoMasterInstanceNameAndNoReplicaConfigurationPresent|TestAccSqlDatabaseInstance_ReplicaPromoteSuccessful|TestAccSqlDatabaseInstance_Smt|TestAccSqlDatabaseInstance_SqlServerAuditOptionalBucket|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_deletionProtection|TestAccSqlDatabaseInstance_settings_deletionProtectionEnabled|TestAccSqlDatabaseInstance_settings_secondary|TestAccSqlDatabaseInstance_settings_upgrade|TestAccSqlDatabaseInstance_slave|TestAccSqlDatabaseInstance_sqlMysqlInstancePvpExample|TestAccSqlDatabaseInstance_updateDifferentFlagOrder|TestAccSqlDatabaseInstance_updateReadReplicaWithBinaryLogEnabled|TestAccSqlDatabaseInstance_updateSslOptionsForPostgreSQL|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_update|TestAccSqlUser_postgres|TestAccSqlUser_postgresAbandon|TestAccSqlUser_postgresIAM
$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccDataSourceGoogleSQLCaCerts_basic[Debug log]
TestAccDataSourceSqlDatabaseInstanceLatestRecoveryTime_basic[Debug log]
TestAccDataSourceSqlDatabaseInstance_basic[Debug log]
TestAccDataSourceSqlDatabaseInstances_basic[Debug log]
TestAccDataSourceSqlDatabaseInstances_databaseVersionFilter[Debug log]
TestAccDataSourceSqlDatabaseInstances_regionFilter[Debug log]
TestAccDataSourceSqlDatabaseInstances_tierFilter[Debug log]
TestAccDataSourceSqlDatabase_basic[Debug log]
TestAccDataSourceSqlDatabases_basic[Debug log]
TestAccSQLDatabaseInstance_DefaultEdition[Debug log]
TestAccSQLDatabaseInstance_DenyMaintenancePeriod[Debug log]
TestAccSQLDatabase_sqlDatabaseBasicExample[Debug log]
TestAccSQLDatabase_sqlDatabaseDeletionPolicyExample[Debug log]
TestAccSqlClientCert_mysql[Debug log]
TestAccSqlClientCert_postgres[Debug log]
TestAccSqlDatabaseInstance_BackupRetention[Debug log]
TestAccSqlDatabaseInstance_Edition[Debug log]
TestAccSqlDatabaseInstance_Edition_Downgrade[Debug log]
TestAccSqlDatabaseInstance_EnableGoogleMlIntegration[Debug log]
TestAccSqlDatabaseInstance_PointInTimeRecoveryEnabled[Debug log]
TestAccSqlDatabaseInstance_PointInTimeRecoveryEnabledForSqlServer[Debug log]
TestAccSqlDatabaseInstance_ReplicaPromoteFailedWithMasterInstanceNameAndReplicaConfigurationPresent[Debug log]
TestAccSqlDatabaseInstance_ReplicaPromoteFailedWithMasterInstanceNamePresent[Debug log]
TestAccSqlDatabaseInstance_ReplicaPromoteFailedWithReplicaConfigurationPresent[Debug log]
TestAccSqlDatabaseInstance_ReplicaPromoteSkippedWithNoMasterInstanceNameAndNoReplicaConfigurationPresent[Debug log]
TestAccSqlDatabaseInstance_ReplicaPromoteSuccessful[Debug log]
TestAccSqlDatabaseInstance_Smt[Debug log]
TestAccSqlDatabaseInstance_SqlServerAuditOptionalBucket[Debug log]
TestAccSqlDatabaseInstance_Timezone[Debug log]
TestAccSqlDatabaseInstance_activationPolicy[Debug log]
TestAccSqlDatabaseInstance_authNets[Debug log]
TestAccSqlDatabaseInstance_basicInstance_thenPSCEnabled[Debug log]
TestAccSqlDatabaseInstance_basicMSSQL[Debug log]
TestAccSqlDatabaseInstance_basicSecondGen[Debug log]
TestAccSqlDatabaseInstance_basic_with_user_labels[Debug log]
TestAccSqlDatabaseInstance_deleteDefaultUserBeforeSubsequentApiCalls[Debug log]
TestAccSqlDatabaseInstance_diskspecs[Debug log]
TestAccSqlDatabaseInstance_dontDeleteDefaultUserOnReplica[Debug log]
TestAccSqlDatabaseInstance_encryptionKey[Debug log]
TestAccSqlDatabaseInstance_encryptionKey_replicaInDifferentRegion[Debug log]
TestAccSqlDatabaseInstance_highAvailability[Debug log]
TestAccSqlDatabaseInstance_insights[Debug log]
TestAccSqlDatabaseInstance_maintenance[Debug log]
TestAccSqlDatabaseInstance_maintenanceVersion[Debug log]
TestAccSqlDatabaseInstance_maintenance_update_track_week5[Debug log]
TestAccSqlDatabaseInstance_multipleOperations[Debug log]
TestAccSqlDatabaseInstance_replica[Debug log]
TestAccSqlDatabaseInstance_rootPasswordShouldBeUpdatable[Debug log]
TestAccSqlDatabaseInstance_settingsDowngrade[Debug log]
TestAccSqlDatabaseInstance_settings_basic[Debug log]
TestAccSqlDatabaseInstance_settings_deletionProtection[Debug log]
TestAccSqlDatabaseInstance_settings_deletionProtectionEnabled[Debug log]
TestAccSqlDatabaseInstance_settings_secondary[Debug log]
TestAccSqlDatabaseInstance_settings_upgrade[Debug log]
TestAccSqlDatabaseInstance_slave[Debug log]
TestAccSqlDatabaseInstance_sqlMysqlInstancePvpExample[Debug log]
TestAccSqlDatabaseInstance_updateDifferentFlagOrder[Debug log]
TestAccSqlDatabaseInstance_updateReadReplicaWithBinaryLogEnabled[Debug log]
TestAccSqlDatabaseInstance_updateSslOptionsForPostgreSQL[Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_thenAddAllowedConsumerProjects_thenRemoveAllowedConsumerProject[Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_withAllowedConsumerProjects[Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_withEmptyAllowedConsumerProjects[Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_withIpV4Enabled[Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_withoutAllowedConsumerProjects[Debug log]
TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange[Debug log]
TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRangeClone[Debug log]
TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRangeReplica[Debug log]
TestAccSqlDatabaseInstance_withPrivateNetwork_withoutAllocatedIpRange[Debug log]
TestAccSqlDatabase_basic[Debug log]
TestAccSqlDatabase_update[Debug log]
TestAccSqlUser_postgres[Debug log]
TestAccSqlUser_postgresAbandon[Debug log]
TestAccSqlUser_postgresIAM[Debug log]
$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$
$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccSqlDatabaseInstance_Mysql_Edition_Upgrade[Error message] [Debug log]
$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test
Hi roaks3, thanks for taking a look.
I have updated the pull request to take care of the failing TestAccSqlDatabaseInstance_Mysql_Edition_Upgrade test, it should now succeed.
- This appears to be a breaking change, because a user that does not set the edition in their config now has different behavior. Can you confirm that is the intention?
Yes it is. The earlier change where we defaulted Edition to "ENTERPRISE" was inconsistent with the CloudSQL API that actually uses default Edition as "EDITION_UNSPECIFIED" (refer: type Settings). Today a "ENTERPRISE" instance is configured similar to a "EDITION_UNSPECIFIED" instance but this could change within the CloudSQL API which will create inconsistent behavior for the customers when dealing directly with CloudSQL API vs Terraform provider.
- The default of ENTERPRISE might have been added for convenience, like if it is often desired by users. Are we sure we would want to remove that?
Issue is that with PostgreSQL version 16, the default Edition will be ENTERPRISE_PLUS as documented in the PostgreSQL June 07, 2024 release notes. Similar to this, if the CloudSQL API changes the default Edition for any database version going forward, Terraform provider will not be able to keep up. I wouldn't want to compromise correctness for convenience.
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 ( 2 files changed, 49 insertions(+), 18 deletions(-))
google-beta provider: Diff ( 2 files changed, 49 insertions(+), 18 deletions(-))
Breaking Change(s) Detected
The following breaking change(s) were detected within your pull request.
- Field
settings.editiondefault value changed from ENTERPRISE toon 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.
Tests analytics
Total tests: 95
Passed tests: 80
Skipped tests: 14
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_Mysql_Edition_Upgrade
$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccSqlDatabaseInstance_Mysql_Edition_Upgrade[Debug log]
$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$
$\textcolor{green}{\textsf{All tests passed!}}$ View the build log or the debug log for each test
I think we missed this during the 6.0.0 window? Our primary unit of accounting were issues in the TPG repo rather than the 6.0.0 label in this repo. FYI @c2thorn we should cover that during the retro, unless I've missed other context.
We should consider whether we want to wait for 7.0.0 (and likely just update examples to specify the new default) or change it in a minor version. IMO it's on the line of whether we consider it acceptable or not- the revised rules in the API are that this is a default controlled by the resource's internal version (the SQL version in this case, we see the same volatile defaults happen with GKE's versions too). Existing configurations that have been applied will not see a diff, and existing configurations that specify an older version (and versions are required!) will adopt the same default.
That does mean that a replacement of a database instance with a newer version would see a changed value. So the scope is pretty small but it does observably change things for those users.
Closing this PR since it is past the major release, there are conflicting files, and will be further broken by the upcoming Go migration.
this will be correctly tracked for 7.0.0 now that I have made a Github issue to track it: https://github.com/hashicorp/terraform-provider-google/issues/19606