Skip to content

Fix bug in Pub/Sub Subscription avroConfig which was not sending empty configurations. #12108

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

Merged

Conversation

mishridaga
Copy link
Contributor

@mishridaga mishridaga commented Oct 23, 2024

Fixes: hashicorp/terraform-provider-google/issues/19658

Release Note Template for Downstream PRs (will be copied)

pubsub: fixed the issue to allow successfully configure empty `cloud_storage_config.avro_config` field in `google_pubsub_subscription`

@github-actions github-actions bot requested a review from shuyama1 October 23, 2024 19:11
Copy link

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

@shuyama1, 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 awaiting-approval Pull requests that need reviewer's approval to run presubmit tests service/pubsub and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Oct 23, 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 ( 1 file changed, 3 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 1 file changed, 3 insertions(+), 3 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 55
Passed tests: 50
Skipped tests: 1
Affected tests: 4

Click here to see the affected service packages
  • pubsub

Action taken

Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccPubsubSubscriptionCloudStorage_serviceAccount
  • TestAccPubsubSubscriptionCloudStorage_updateText
  • TestAccPubsubSubscription_pubsubSubscriptionPushCloudstorageExample
  • TestAccPubsubSubscription_pubsubSubscriptionPushCloudstorageServiceAccountExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccPubsubSubscriptionCloudStorage_serviceAccount [Debug log]
TestAccPubsubSubscriptionCloudStorage_updateText [Debug log]
TestAccPubsubSubscription_pubsubSubscriptionPushCloudstorageExample [Debug log]
TestAccPubsubSubscription_pubsubSubscriptionPushCloudstorageServiceAccountExample [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

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Could you add a new test or modify an existing one to explicitly specify avro_config {}?

@github-actions github-actions bot requested a review from shuyama1 October 29, 2024 21:35
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Oct 29, 2024
@mishridaga
Copy link
Contributor Author

Could you add a new test or modify an existing one to explicitly specify avro_config {}?

done!

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Oct 30, 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 ( 2 files changed, 39 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 2 files changed, 39 insertions(+), 3 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 56
Passed tests: 54
Skipped tests: 1
Affected tests: 1

Click here to see the affected service packages
  • pubsub

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
  • TestAccPubsubSubscriptionCloudStorage_updateAvroEmpty

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccPubsubSubscriptionCloudStorage_updateAvroEmpty [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

Copy link

github-actions bot commented Nov 1, 2024

@shuyama1 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Test failed due to

    resource_pubsub_subscription_test.go:364: Step 3/4 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # google_pubsub_subscription.foo will be updated in-place
          ~ resource "google_pubsub_subscription" "foo" {
                id                           = "projects/ci-test-project-188019/subscriptions/tf-test-sub-qqpx9baf3m"
                name                         = "tf-test-sub-qqpx9baf3m"
                # (11 unchanged attributes hidden)
        
              ~ cloud_storage_config {
                    # (9 unchanged attributes hidden)
        
                  + avro_config {}
                }
        
                # (1 unchanged block hidden)
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.

Please let me know if you need help debug the issue. https://googlecloudplatform.github.io/magic-modules/develop/diffs/, in case it helps

@github-actions github-actions bot requested a review from shuyama1 November 11, 2024 17:17
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Nov 11, 2024
Copy link

@shuyama1 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Nov 15, 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 ( 2 files changed, 30 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 2 files changed, 30 insertions(+), 3 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 56
Passed tests: 54
Skipped tests: 1
Affected tests: 1

Click here to see the affected service packages
  • pubsub

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
  • TestAccPubsubSubscriptionCloudStorage_emptyAvroConfig

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccPubsubSubscriptionCloudStorage_emptyAvroConfig [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

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

The test failed due to the same error, likely you'll need to add allow_empty_object: true to avroConfig field to allow sending avro_config {} to the API.

@github-actions github-actions bot requested a review from shuyama1 November 15, 2024 16:33
@mishridaga
Copy link
Contributor Author

@shuyama1 thanks for the pointer! What is the best way for me to trigger these tests? Running the tests following https://googlecloudplatform.github.io/magic-modules/develop/test/run-tests/ doesn't seem to be showing me the errors.

@shuyama1
Copy link
Member

@shuyama1 thanks for the pointer! What is the best way for me to trigger these tests? Running the tests following googlecloudplatform.github.io/magic-modules/develop/test/run-tests doesn't seem to be showing me the errors.

You can probably follow the steps in https://googlecloudplatform.github.io/magic-modules/develop/test/run-tests/#run-automated-tests and run TF_LOG=DEBUG make testacc TEST=./google/services/pubsub TESTARGS='-run=TestAccPubsubSubscriptionCloudStorage_emptyAvroConfig' > output.log. Then the output.log file should contain the debug info

@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 ( 2 files changed, 36 insertions(+), 7 deletions(-))
google-beta provider: Diff ( 2 files changed, 36 insertions(+), 7 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 9 insertions(+), 4 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 56
Passed tests: 54
Skipped tests: 1
Affected tests: 1

Click here to see the affected service packages
  • pubsub

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
  • TestAccPubsubSubscriptionCloudStorage_emptyAvroConfig

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccPubsubSubscriptionCloudStorage_emptyAvroConfig [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

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