Skip to content

feat(bigqueryanalyticshub): add multi-region support to listings and …#16156

Merged
ScottSuarez merged 3 commits into
GoogleCloudPlatform:mainfrom
okvidhi:multiregion-support-v2
Jan 22, 2026
Merged

feat(bigqueryanalyticshub): add multi-region support to listings and …#16156
ScottSuarez merged 3 commits into
GoogleCloudPlatform:mainfrom
okvidhi:multiregion-support-v2

Conversation

@okvidhi

@okvidhi okvidhi commented Jan 18, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds multi-region support to the BigQuery Analytics Hub listing and listing_subscription resources in the google-beta provider. This enhancement allows publishers to specify existing dataset replicas and allows subscribers to request replicas for their destination datasets.

This work takes over and finalizes the logic from the original PR #14481.

Key Changes

  • Feature Addition: Added replica_locations and effective_replicas fields to google_bigquery_analytics_hub_listing.
  • Feature Addition: Added replica_locations field to google_bigquery_analytics_hub_listing_subscription.
  • Beta Scoping: Used min_version: 'beta' in YAML and implemented version guards ({{- if ne ... }}) in renamed .go.tmpl test files to correctly restrict the feature to the beta provider.
  • Logic Improvements:
    • Applied tpgresource.CaseDiffSuppress to location fields to allow case-insensitive region input.
    • Implemented a custom CaseInsensitiveHash function in common_diff_suppress.go and configured set_hash_func in YAML to ensure the replica_locations Set handles case differences (e.g., "eu" vs "EU") without triggering a diff.
  • Build Fixes: Resolved "unused import" errors in the GA provider and correctly implemented ProtoV5ProviderBetaFactories for beta-specific acceptance tests.

Testing Performed

Manual verification in a test project confirmed:

  • Successful creation of listings and subscriptions with replicas.
  • Successful import of existing multi-region resources into Terraform state.
  • Proper handling of API constraints (blocking replica removal if it still exists in BigQuery).
  • Correct case-insensitive behavior for both string and set fields.
  • Correct scoping (feature is unavailable in the GA provider).

Bypass Note

BYPASS_BQUI_SCREENSHOT_BAN_PRESUBMIT=Updating existing screenshot goldens to reflect Terraform provider changes for the multi-region feature.

bigqueryanalyticshub: added `replica_locations` and `effective_replicas` fields to `google_bigquery_analytics_hub_listing` and `replica_locations` field to `google_bigquery_analytics_hub_listing_subscription` (beta)

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 18, 2026
@github-actions

Copy link
Copy Markdown

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

Googlers: For automatic test runs see go/terraform-auto-test-runs.

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

@github-actions github-actions Bot requested a review from ScottSuarez January 18, 2026 16:43
@okvidhi okvidhi requested a review from prashastia January 20, 2026 04:25
@prashastia

Copy link
Copy Markdown

@shashambhavi PTAL. LGTM from my side.

@modular-magician modular-magician added service/bigquery and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Jan 20, 2026
@modular-magician

Copy link
Copy Markdown
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 ( 9 files changed, 278 insertions(+), 238 deletions(-))
google-beta provider: Diff ( 12 files changed, 597 insertions(+), 213 deletions(-))
terraform-google-conversion: Diff ( 3 files changed, 86 insertions(+))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 5930
Passed tests: 5291
Skipped tests: 633
Affected tests: 6

Click here to see the affected service packages

All service packages are affected

Action taken

Found 6 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccAccessContextManager__service_perimeter_dry_run_egress_policy
  • TestAccAccessContextManager__service_perimeter_dry_run_ingress_policy
  • TestAccBigqueryAnalyticsHubListingSubscription_differentProject
  • TestAccBigqueryAnalyticsHubListingSubscription_multiregion
  • TestAccBigqueryAnalyticsHubListing_bigqueryAnalyticshubListingUpdate
  • TestAccBigqueryAnalyticsHubListing_multiregion

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccAccessContextManager__access_level [Debug log]
TestAccAccessContextManager__access_level_condition [Debug log]
TestAccAccessContextManager__access_level_custom [Debug log]
TestAccAccessContextManager__access_level_full [Debug log]
TestAccAccessContextManager__access_levels [Debug log]
TestAccAccessContextManager__access_policy [Debug log]
TestAccAccessContextManager__access_policy_scoped [Debug log]
TestAccAccessContextManager__authorized_orgs_desc [Debug log]
TestAccAccessContextManager__service_perimeter [Debug log]
TestAccAccessContextManager__service_perimeter_dry_run_egress_policy [Debug log]
TestAccAccessContextManager__service_perimeter_dry_run_ingress_policy [Debug log]
TestAccAccessContextManager__service_perimeter_update [Debug log]
TestAccAccessContextManager__service_perimeters [Debug log]
TestAccBigqueryAnalyticsHubListingSubscription_differentProject [Debug log]
TestAccBigqueryAnalyticsHubListingSubscription_multiregion [Debug log]
TestAccBigqueryAnalyticsHubListing_bigqueryAnalyticshubListingUpdate [Debug log]
TestAccBigqueryAnalyticsHubListing_multiregion [Debug log]

🔴 Tests failed when rerunning REPLAYING mode:
TestAccAccessContextManager__service_perimeter_dry_run_egress_policy [Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


🟢 All tests passed!

View the build log or the debug log for each test

@okvidhi

okvidhi commented Jan 21, 2026

Copy link
Copy Markdown
Contributor Author

hey, I see one test failed when rerunning REPLAYING mode:
TestAccAccessContextManager__service_perimeter_dry_run_egress_policy
I believe this is not related to the changes we made. Can anyone confirm? @ScottSuarez

@ScottSuarez ScottSuarez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The failing test looks unrelated. Looks like we have 'steps' defined on the examples which don't exist on the example schema. Could we remove them - I suspect this is due to the migration from samples back to examples.

Comment thread mmv1/products/bigqueryanalyticshub/Listing.yaml Outdated
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 22, 2026
@github-actions github-actions Bot requested a review from ScottSuarez January 22, 2026 05:18
@okvidhi

okvidhi commented Jan 22, 2026

Copy link
Copy Markdown
Contributor Author

@ScottSuarez I have addressed your comment, kindly let me know if anything else is required on my end.

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 22, 2026
@modular-magician

Copy link
Copy Markdown
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 ( 9 files changed, 278 insertions(+), 238 deletions(-))
google-beta provider: Diff ( 12 files changed, 597 insertions(+), 213 deletions(-))
terraform-google-conversion: Diff ( 3 files changed, 86 insertions(+))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 5950
Passed tests: 5315
Skipped tests: 633
Affected tests: 2

Click here to see the affected service packages

All service packages are affected

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccAccessContextManager__service_perimeter_dry_run_egress_policy
  • TestAccAccessContextManager__service_perimeter_dry_run_ingress_policy

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccAccessContextManager__access_level [Debug log]
TestAccAccessContextManager__access_level_condition [Debug log]
TestAccAccessContextManager__access_level_custom [Debug log]
TestAccAccessContextManager__access_level_full [Debug log]
TestAccAccessContextManager__access_levels [Debug log]
TestAccAccessContextManager__access_policy [Debug log]
TestAccAccessContextManager__access_policy_scoped [Debug log]
TestAccAccessContextManager__authorized_orgs_desc [Debug log]
TestAccAccessContextManager__service_perimeter [Debug log]
TestAccAccessContextManager__service_perimeter_dry_run_egress_policy [Debug log]
TestAccAccessContextManager__service_perimeter_dry_run_ingress_policy [Debug log]
TestAccAccessContextManager__service_perimeter_update [Debug log]
TestAccAccessContextManager__service_perimeters [Debug log]

🔴 Tests failed when rerunning REPLAYING mode:
TestAccAccessContextManager__service_perimeter_dry_run_egress_policy [Error message] [Debug log]
TestAccAccessContextManager__service_perimeter_dry_run_ingress_policy [Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


🟢 All tests passed!

View the build log or the debug log for each test

@ScottSuarez ScottSuarez added this pull request to the merge queue Jan 22, 2026
Merged via the queue into GoogleCloudPlatform:main with commit e00a384 Jan 22, 2026
30 of 31 checks passed
aditikumarii-google pushed a commit to aditikumarii-google/magic-modules that referenced this pull request Mar 10, 2026
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.

4 participants