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

Added instance_type field to google_sql_database_instance resource #7044

Merged
merged 9 commits into from
Jan 6, 2023

Conversation

ravisiddhu
Copy link
Contributor

@ravisiddhu ravisiddhu commented Dec 23, 2022

This PR is in effort to fix hashicorp/terraform-provider-google#11424

Buganizer ticket Id : b/259900473

I have added a compute only attribute instance_type in google_sql_database_instance resource. This field already exist in the instance object in admin api. https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances

This field is necessary during update API calls, so that the API could distinguish between a regular instance and read replica instance.

sql: added `instance_type` field to `google_sql_database_instance` resource

@modular-magician
Copy link
Collaborator

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

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

❓ 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
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.

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

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2379
Passed tests 2122
Skipped tests: 248
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
TestAccContainerCluster_withInvalidGatewayApiConfigChannel|TestAccSqlDatabaseInstance_settings_upgrade|TestAccSqlDatabaseInstance_PointInTimeRecoveryEnabled|TestAccSqlDatabaseInstance_authNets|TestAccSqlDatabaseInstance_settings_deletionProtectionEnabled|TestAccSqlDatabaseInstance_mysqlMajorVersionUpgrade|TestAccSqlDatabaseInstance_settings_deletionProtection|TestAccSqlDatabaseInstance_basic_with_user_labels|TestAccSqlDatabaseInstance_basicMSSQL

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccContainerCluster_withInvalidGatewayApiConfigChannel[Debug log]
TestAccSqlDatabaseInstance_settings_upgrade[Debug log]
TestAccSqlDatabaseInstance_PointInTimeRecoveryEnabled[Debug log]
TestAccSqlDatabaseInstance_authNets[Debug log]
TestAccSqlDatabaseInstance_settings_deletionProtectionEnabled[Debug log]
TestAccSqlDatabaseInstance_mysqlMajorVersionUpgrade[Debug log]
TestAccSqlDatabaseInstance_settings_deletionProtection[Debug log]
TestAccSqlDatabaseInstance_basic_with_user_labels[Debug log]
TestAccSqlDatabaseInstance_basicMSSQL[Debug log]

All tests passed
View the build log or the debug log for each test

@c2thorn
Copy link
Member

c2thorn commented Jan 5, 2023

Adding this field looks fine, but I don't see a guarantee that it fixes the issue in hashicorp/terraform-provider-google#11424

Can we add a test that confirms this?

…rly log enabled with the support of the instance_type field.
@ravisiddhu
Copy link
Contributor Author

ravisiddhu commented Jan 6, 2023

I have manually tested it and now I have also added a test function which tests the update of replica instance with binary log enabled. I also ran the test without the instance_type field then it failed with :-

Error: Error, failed to update instance settings for : googleapi: Error 400: Invalid request: Binary log must be disabled when backup is disabled or the instance must be a replica instance with a MySQL 5.7 or above version., invalid

The test successfully passes only with the instance_type filed ensuring the fix for hashicorp/terraform-provider-google#11424

@c2thorn
Copy link
Member

c2thorn commented Jan 6, 2023

/gcbrun

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

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

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2392
Passed tests 2137
Skipped tests: 248
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
TestAccSqlDatabaseInstance_updateReadReplicaWithBinaryLogEnabled|TestAccDatastreamStream_update|TestAccDatastreamStream_datastreamStreamFullExample|TestAccDatastreamStream_datastreamStreamBasicExample|TestAccContainerCluster_withInvalidGatewayApiConfigChannel|TestAccComposerEnvironment_UpdateComposerV2|TestAccComposerEnvironment_ComposerV2

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccSqlDatabaseInstance_updateReadReplicaWithBinaryLogEnabled[Debug log]
TestAccDatastreamStream_update[Debug log]
TestAccDatastreamStream_datastreamStreamFullExample[Debug log]
TestAccDatastreamStream_datastreamStreamBasicExample[Debug log]
TestAccContainerCluster_withInvalidGatewayApiConfigChannel[Debug log]
TestAccComposerEnvironment_UpdateComposerV2[Debug log]
TestAccComposerEnvironment_ComposerV2[Debug log]

All tests passed
View the build log or the debug log for each test

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.

Cannot update Cloud SQL read replica instance with binary logging enabled
4 participants