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

Update bq connection types from v1 api #6025

Merged
merged 11 commits into from
May 19, 2022

Conversation

maduris
Copy link
Contributor

@maduris maduris commented May 11, 2022

Update connection types of google_bigquery_connection from v1 api. Fixes hashicorp/terraform-provider-google#11053 and hashicorp/terraform-provider-google#11459

If this PR is for Terraform, I acknowledge that I have:

  • 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).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • 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).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

bigqueryconnection: Update connection types to support v1 ga

@google-cla
Copy link

google-cla bot commented May 11, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

For more information, open the CLA check for this pull request.

@modular-magician
Copy link
Collaborator

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

  • REPLACEME

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

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


@maduris maduris changed the title Feat/bq connection ga Update bq connection types from v1 api May 11, 2022
@modular-magician
Copy link
Collaborator

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

Diff report:

Terraform GA: Diff ( 7 files changed, 1770 insertions(+), 29 deletions(-))
Terraform Beta: Diff ( 8 files changed, 832 insertions(+), 43 deletions(-))
TF Validator: Diff ( 4 files changed, 389 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 17 files changed, 442 insertions(+), 4 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2018
Passed tests 1771
Skipped tests: 242
Failed tests: 5

Action taken

Triggering VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample|TestAccBigqueryConnectionConnection_bigqueryConnectionCloudspannerExample|TestAccBigqueryConnectionConnection_bigqueryConnectionAzureExample|TestAccBigqueryConnectionConnection_bigqueryConnectionAwsExample|TestAccBigqueryConnectionConnection_bigqueryConnectionCloudResourceExample

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode:
TestAccBigqueryConnectionConnection_bigqueryConnectionCloudResourceExample[view]
TestAccBigqueryConnectionConnection_bigqueryConnectionCloudspannerExample[view]
TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample[view]
TestAccBigqueryConnectionConnection_bigqueryConnectionAzureExample[view]
TestAccBigqueryConnectionConnection_bigqueryConnectionAwsExample[view]

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

@maduris
Copy link
Contributor Author

maduris commented May 12, 2022

@rileykarson
Copy link
Member

Given we're introducing a GA version here we can likely just remove the version tags (the <% lines) in that file as a whole! @ScottSuarez can help make the appropriate change.

The failure messages look like a difference in supported regions between beta/GA at first glance, which is concerning- that may block making this change since it would be breaking for existing users:

=== RUN   TestAccBigqueryConnectionConnection_bigqueryConnectionCloudResourceExample
=== PAUSE TestAccBigqueryConnectionConnection_bigqueryConnectionCloudResourceExample
=== RUN   TestAccBigqueryConnectionConnection_bigqueryConnectionAwsExample
=== PAUSE TestAccBigqueryConnectionConnection_bigqueryConnectionAwsExample
=== RUN   TestAccBigqueryConnectionConnection_bigqueryConnectionAzureExample
=== PAUSE TestAccBigqueryConnectionConnection_bigqueryConnectionAzureExample
=== RUN   TestAccBigqueryConnectionConnection_bigqueryConnectionCloudspannerExample
=== PAUSE TestAccBigqueryConnectionConnection_bigqueryConnectionCloudspannerExample
=== RUN   TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample
=== PAUSE TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample
=== CONT  TestAccBigqueryConnectionConnection_bigqueryConnectionCloudResourceExample
    provider_test.go:309: Step 1/2 error: Error running apply: exit status 1
        
        Error: Error creating Connection: googleapi: Error 400: Unable to recognize type of the connection properties.
        
          on terraform_plugin_test.tf line 2, in resource "google_bigquery_connection" "connection":
           2: resource "google_bigquery_connection" "connection" {
        
        
--- FAIL: TestAccBigqueryConnectionConnection_bigqueryConnectionCloudResourceExample (3.33s)
=== CONT  TestAccBigqueryConnectionConnection_bigqueryConnectionCloudspannerExample
    provider_test.go:309: Step 1/2 error: Error running apply: exit status 1
        
        Error: Error creating Connection: googleapi: Error 400: Cloud Spanner database id must be of the form projects/{project=*}/instances/{instance=*}/databases/{database=*}
        
          on terraform_plugin_test.tf line 2, in resource "google_bigquery_connection" "connection":
           2: resource "google_bigquery_connection" "connection" {
        
        
--- FAIL: TestAccBigqueryConnectionConnection_bigqueryConnectionCloudspannerExample (3.25s)
=== CONT  TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample
    provider_test.go:309: Step 1/2 error: Error running apply: exit status 1
        
        Error: Error creating FolderFeed: googleapi: Error 400: Fail to use projects/ci-test-project-188019/topics/tf-test-network-updatespbt0a7dszi as feed output destination. Error: PERMISSION_DENIED: User not authorized to perform this action. [type.googleapis.com/util.MessageSetPayload='[google.rpc.error_details_ext] { message: "User not authorized to perform this action." details { [type.googleapis.com/google.rpc.DebugInfo] { detail: "PermissionResponse.success = false for resource \'projects/ci-test-project-188019/topics/tf-test-network-updatespbt0a7dszi\': " } } }']
        Details:
        [
          {
            "@type": "type.googleapis.com/google.rpc.BadRequest",
            "fieldViolations": [
              {
                "description": "Fail to use projects/ci-test-project-188019/topics/tf-test-network-updatespbt0a7dszi as feed output destination. Error: PERMISSION_DENIED: User not authorized to perform this action. [type.googleapis.com/util.MessageSetPayload='[google.rpc.error_details_ext] { message: \"User not authorized to perform this action.\" details { [type.googleapis.com/google.rpc.DebugInfo] { detail: \"PermissionResponse.success = false for resource \\'projects/ci-test-project-188019/topics/tf-test-network-updatespbt0a7dszi\\': \" } } }']",
                "field": "feed.feed_output_config.pubsub_destination.topic"
              }
            ]
          }
        ]
        
          on terraform_plugin_test.tf line 4, in resource "google_cloud_asset_folder_feed" "folder_feed":
           4: resource "google_cloud_asset_folder_feed" "folder_feed" {
        
        
--- FAIL: TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample (14.82s)
=== CONT  TestAccBigqueryConnectionConnection_bigqueryConnectionAzureExample
    provider_test.go:309: Step 1/2 error: Error running apply: exit status 1
        
        Error: Error creating Connection: googleapi: Error 400: Azure connection is not supported in this region.
        
          on terraform_plugin_test.tf line 2, in resource "google_bigquery_connection" "connection":
           2: resource "google_bigquery_connection" "connection" {
        
        
--- FAIL: TestAccBigqueryConnectionConnection_bigqueryConnectionAzureExample (3.28s)
=== CONT  TestAccBigqueryConnectionConnection_bigqueryConnectionAwsExample
    provider_test.go:309: Step 1/2 error: Error running apply: exit status 1
        
        Error: Error creating Connection: googleapi: Error 400: AWS connection is not supported in this region.
        
          on terraform_plugin_test.tf line 2, in resource "google_bigquery_connection" "connection":
           2: resource "google_bigquery_connection" "connection" {
        
        
--- FAIL: TestAccBigqueryConnectionConnection_bigqueryConnectionAwsExample (3.28s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-google-beta/google-beta	28.006s
FAIL

@rileykarson
Copy link
Member

(you can ignore TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample, it's unrelated)

@ScottSuarez
Copy link
Contributor

The new tests seem to be failing as US isn't a valid location for a bigquery connection.
https://cloud.google.com/bigquery/docs/locations#supported_regions

@ScottSuarez
Copy link
Contributor

If you need help working with the codebase or understanding something feel free to ping me

@modular-magician
Copy link
Collaborator

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

  • bigquery connection v1 support

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

@modular-magician
Copy link
Collaborator

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

Diff report:

Terraform GA: Diff ( 9 files changed, 1920 insertions(+), 32 deletions(-))
Terraform Beta: Diff ( 9 files changed, 842 insertions(+), 51 deletions(-))
TF Validator: Diff ( 4 files changed, 389 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 17 files changed, 443 insertions(+), 4 deletions(-))

@maduris maduris force-pushed the feat/bq-connection-ga branch from 0cd9710 to 5fe9a5a Compare May 13, 2022 03:44
@modular-magician
Copy link
Collaborator

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

Diff report:

Terraform GA: Diff ( 9 files changed, 1920 insertions(+), 32 deletions(-))
Terraform Beta: Diff ( 7 files changed, 840 insertions(+), 49 deletions(-))
TF Validator: Diff ( 4 files changed, 389 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 17 files changed, 443 insertions(+), 4 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2022
Passed tests 1774
Skipped tests: 242
Failed tests: 6

Action taken

Triggering VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccFirebaserulesRelease_BasicRelease|TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample|TestAccBigqueryConnectionConnection_bigqueryConnectionCloudspannerExample|TestAccBigqueryConnectionConnection_bigqueryConnectionAzureExample|TestAccBigqueryConnectionConnection_bigqueryConnectionAwsExample|TestAccBigqueryConnectionConnection_bigqueryConnectionCloudResourceExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[view]
TestAccBigqueryConnectionConnection_bigqueryConnectionCloudspannerExample[view]

Tests failed during RECORDING mode:
TestAccBigqueryConnectionConnection_bigqueryConnectionCloudResourceExample[view]
TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample[view]
TestAccBigqueryConnectionConnection_bigqueryConnectionAzureExample[view]
TestAccBigqueryConnectionConnection_bigqueryConnectionAwsExample[view]

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

@modular-magician
Copy link
Collaborator

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

Diff report:

Terraform GA: Diff ( 6 files changed, 818 insertions(+), 21 deletions(-))
Terraform Beta: Diff ( 6 files changed, 674 insertions(+), 22 deletions(-))
TF Validator: Diff ( 3 files changed, 176 insertions(+), 4 deletions(-))
TF OiCS: Diff ( 13 files changed, 333 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2022
Passed tests 1786
Skipped tests: 231
Failed tests: 5

Action taken

Triggering VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccFirebaserulesRelease_BasicRelease|TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample|TestAccBigqueryConnectionConnection_bigqueryConnectionCloudResourceExample|TestAccBigqueryConnectionConnection_bigqueryConnectionAzureExample|TestAccBigqueryConnectionConnection_bigqueryConnectionAwsExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[view]
TestAccBigqueryConnectionConnection_bigqueryConnectionAwsExample[view]

Tests failed during RECORDING mode:
TestAccBigqueryConnectionConnection_bigqueryConnectionCloudResourceExample[view]
TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample[view]
TestAccBigqueryConnectionConnection_bigqueryConnectionAzureExample[view]

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

@modular-magician
Copy link
Collaborator

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

Diff report:

Terraform GA: Diff ( 6 files changed, 813 insertions(+), 17 deletions(-))
Terraform Beta: Diff ( 7 files changed, 677 insertions(+), 26 deletions(-))
TF Validator: Diff ( 3 files changed, 176 insertions(+), 4 deletions(-))
TF OiCS: Diff ( 13 files changed, 333 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2022
Passed tests 1787
Skipped tests: 231
Failed tests: 4

Action taken

Triggering VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccFirebaserulesRelease_BasicRelease|TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample|TestAccBigqueryConnectionConnection_bigqueryConnectionAzureExample|TestAccBigqueryConnectionConnection_bigqueryConnectionCloudResourceExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[view]
TestAccBigqueryConnectionConnection_bigqueryConnectionAzureExample[view]

Tests failed during RECORDING mode:
TestAccBigqueryConnectionConnection_bigqueryConnectionCloudResourceExample[view]
TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample[view]

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

@maduris
Copy link
Contributor Author

maduris commented May 16, 2022

hi @ScottSuarez, the tests for cloudspanner, aws, azure are passing, but TestAccBigqueryConnectionConnection_bigqueryConnectionCloudResourceExample is not passing, however it passes when I tested manually building the provider, And I noticed this change has already been merged to main branch from another PR, could we merge this pr now?

@ScottSuarez
Copy link
Contributor

And I noticed this change has already been merged to main branch from another PR, could we merge this pr now?

Do you have a reference for this? Could you rebase this PR.
These tests are still failing for seemingly valid reasons. I suspect this is because we aren't sending cloudresource field if it's empty anymore.

@maduris
Copy link
Contributor Author

maduris commented May 18, 2022

Do you have a reference for this? Could you rebase this PR. These tests are still failing for seemingly valid reasons. I suspect this is because we aren't sending cloudresource field if it's empty anymore.

#6020

@modular-magician
Copy link
Collaborator

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

Diff report:

Terraform GA: Diff ( 6 files changed, 821 insertions(+), 25 deletions(-))
Terraform Beta: Diff ( 5 files changed, 673 insertions(+), 22 deletions(-))
TF Validator: Diff ( 3 files changed, 176 insertions(+), 4 deletions(-))
TF OiCS: Diff ( 13 files changed, 333 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2022
Passed tests 1793
Skipped tests: 226
Failed tests: 3

Action taken

Triggering VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccFirebaserulesRelease_BasicRelease|TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample|TestAccBigqueryConnectionConnection_bigqueryConnectionCloudResourceExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[view]

Tests failed during RECORDING mode:
TestAccBigqueryConnectionConnection_bigqueryConnectionCloudResourceExample[view]
TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample[view]

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

@maduris
Copy link
Contributor Author

maduris commented May 19, 2022

hi @ScottSuarez, found the issue, fixed the test for cloudResource, could you please review and let me know?

@modular-magician
Copy link
Collaborator

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

Diff report:

Terraform GA: Diff ( 8 files changed, 821 insertions(+), 25 deletions(-))
Terraform Beta: Diff ( 6 files changed, 673 insertions(+), 22 deletions(-))
TF Validator: Diff ( 3 files changed, 175 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 13 files changed, 333 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2022
Passed tests 1792
Skipped tests: 226
Failed tests: 4

Action taken

Triggering VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample|TestAccBigqueryConnectionConnection_bigqueryConnectionAwsExample|TestAccBigqueryConnectionConnection_bigqueryConnectionCloudspannerExample|TestAccBigqueryConnectionConnection_bigqueryConnectionAzureExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccBigqueryConnectionConnection_bigqueryConnectionAwsExample[view]
TestAccBigqueryConnectionConnection_bigqueryConnectionCloudspannerExample[view]
TestAccBigqueryConnectionConnection_bigqueryConnectionAzureExample[view]

Tests failed during RECORDING mode:
TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample[view]

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

Copy link
Contributor

@ScottSuarez ScottSuarez left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support BigQuery external connection for Spanner in google_bigquery_connection
4 participants