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

Datasource - google_sql_database_instances #6980

Merged
merged 14 commits into from
Jan 10, 2023

Conversation

ravisiddhu
Copy link
Contributor

@ravisiddhu ravisiddhu commented Dec 16, 2022

This PR is to create a new data source as request in the issue mentioned in hashicorp/terraform-provider-google#8164
Buganizer reference : (b/259913353): EXT: Datasource google_sql_database_instances

I have created a new data source called "google_sql_database_instance_list" which would fetch all the database instances in a project, and u can apply filters on top of it {project, database_version, region, zone, tier and state}.

I have tested this new data source with unit tests.

`google_sql_database_instances`

@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. @SarahFrench, 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 ( 4 files changed, 564 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 4 files changed, 564 insertions(+), 1 deletion(-))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2357
Passed tests 2104
Skipped tests: 247
Failed tests: 6

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccDataSourceSqlDatabaseInstanceList_regionFilter|TestAccDataSourceSqlDatabaseInstanceList_databaseVersionFilter|TestAccDataSourceSqlDatabaseInstanceList_basic|TestAccLoggingBucketConfigProject_cmekSettings|TestAccContainerCluster_withInvalidGatewayApiConfigChannel|TestAccFirebaserulesRelease_BasicRelease

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccDataSourceSqlDatabaseInstanceList_databaseVersionFilter[Debug log]
TestAccDataSourceSqlDatabaseInstanceList_basic[Debug log]
TestAccLoggingBucketConfigProject_cmekSettings[Debug log]
TestAccContainerCluster_withInvalidGatewayApiConfigChannel[Debug log]
TestAccFirebaserulesRelease_BasicRelease[Debug log]

Tests failed during RECORDING mode:
TestAccDataSourceSqlDatabaseInstanceList_regionFilter[Error message] [Debug log]

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

@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 ( 4 files changed, 636 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 4 files changed, 636 insertions(+), 1 deletion(-))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2358
Passed tests 2105
Skipped tests: 247
Failed tests: 6

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccDataSourceSqlDatabaseInstanceList_tierFilter|TestAccDataSourceSqlDatabaseInstanceList_regionFilter|TestAccLoggingBucketConfigProject_cmekSettings|TestAccDataSourceGoogleServiceAccountIdToken_impersonation|TestAccFirebaserulesRelease_BasicRelease|TestAccContainerCluster_withInvalidGatewayApiConfigChannel

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccDataSourceSqlDatabaseInstanceList_tierFilter[Debug log]
TestAccDataSourceSqlDatabaseInstanceList_regionFilter[Debug log]
TestAccLoggingBucketConfigProject_cmekSettings[Debug log]
TestAccDataSourceGoogleServiceAccountIdToken_impersonation[Debug log]
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccContainerCluster_withInvalidGatewayApiConfigChannel[Debug log]

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

Copy link
Contributor

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

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

Hi @ravisiddhu 👋 Thanks for your PR!

Could you please add some documentation to accompany the new data source? When a new handwritten resource/data source is added the documentation needs to be handwritten too. This is easy to miss because we haven't added guidance about this to our contribution docs yet!

Also, I've left some comments asking for some changes in the code related to naming and the sql_user resource.

- Sarah


Here's some guidance to help with writing the docs:

  • You'd need to create a file called sql_database_instances.html.markdown in the mmv1/third_party/terraform/website/docs/d/ folder. The file's location is important here; d == data sources.
  • You can copy the existing documentation for the sql_database_instance data source but change the text to be for a plural data source. Note that you don't need to reproduce all the info about arguments - just link off to the resource that corresponds to your data source.
  • This tool lets you copy/paste in your handwritten documentation markdown and see how it would be rendered in the Registry website : Doc Preview Tool

@SarahFrench SarahFrench self-assigned this Dec 20, 2022
@ravisiddhu
Copy link
Contributor Author

I have added the documentation for the new data source, and I have also reverted the changes in the google_sql_user resource.

@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 ( 4 files changed, 652 insertions(+))
Terraform Beta: Diff ( 4 files changed, 652 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2377
Passed tests 2121
Skipped tests: 248
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
TestAccContainerCluster_withInvalidGatewayApiConfigChannel|TestAccComputeForwardingRule_update|TestAccLoggingBucketConfigProject_cmekSettings|TestAccDataSourceSqlDatabaseInstances_regionFilter|TestAccDataSourceSqlDatabaseInstances_basic|TestAccDataSourceSqlDatabaseInstances_databaseVersionFilter|TestAccDataSourceSqlDatabaseInstances_tierFilter|TestAccFirebaserulesRelease_BasicRelease

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccContainerCluster_withInvalidGatewayApiConfigChannel[Debug log]
TestAccComputeForwardingRule_update[Debug log]
TestAccLoggingBucketConfigProject_cmekSettings[Debug log]
TestAccDataSourceSqlDatabaseInstances_regionFilter[Debug log]
TestAccDataSourceSqlDatabaseInstances_basic[Debug log]
TestAccDataSourceSqlDatabaseInstances_databaseVersionFilter[Debug log]
TestAccDataSourceSqlDatabaseInstances_tierFilter[Debug log]
TestAccFirebaserulesRelease_BasicRelease[Debug log]

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

@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 ( 4 files changed, 652 insertions(+))
Terraform Beta: Diff ( 4 files changed, 652 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2383
Passed tests 2133
Skipped tests: 248
Failed tests: 2

Action taken

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

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccContainerCluster_withInvalidGatewayApiConfigChannel[Debug log]

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

Copy link
Contributor

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

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

Thanks for adding the documentation - I've made some suggested changes for a few pluralisation-related changes, but besides that I think this PR is ready to merge!

Also, I'll hold off on approval until the other reviewer's comments are addressed/resolved

@ravisiddhu
Copy link
Contributor Author

I have made the suggested changes.

@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 ( 4 files changed, 650 insertions(+))
Terraform Beta: Diff ( 4 files changed, 650 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2390
Passed tests 2141
Skipped tests: 248
Failed tests: 1

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccContainerCluster_withInvalidGatewayApiConfigChannel

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccContainerCluster_withInvalidGatewayApiConfigChannel[Debug log]

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

@SarahFrench SarahFrench changed the title Datasource Datasource - google_sql_database_instances Jan 5, 2023
Copy link
Contributor

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

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

Thanks for the changes, approved!

@ravisiddhu
Copy link
Contributor Author

@SarahFrench Could you please merge this PR?

@SarahFrench SarahFrench merged commit 3f9409b into GoogleCloudPlatform:main Jan 10, 2023
i-laird pushed a commit to i-laird/magic-modules that referenced this pull request Jan 10, 2023
* Added validation for "type" in cloud_sql_user_resource for preventing user from setting "password" or "host" for CLOUD_IAM_USER and CLOUD_IAM_SERVICE_ACCOUNT user types.

* Added new data_source_sql_database_instance_list data source and test file

* Added new data_source_sql_database_instance_list data source and test file

* Reverting validation of usert types, this would be added as a seperate PR

* Added documentation for the new google_sql_database_instances data source

* mend

* mend

* mend

* mend

* mend
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.

5 participants