这是indexloc提供的服务,不要输入任何密码
Skip to content

bigqueryreservation: added support for scaling_mode and max_slots properties on google_bigquery_reservation (beta) #14056

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ramonvermeulen
Copy link
Contributor

@ramonvermeulen ramonvermeulen commented May 21, 2025

Closes hashicorp/terraform-provider-google#22947

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

bigqueryreservation: added support for `scaling_mode` and `max_slots` properties on `google_bigquery_reservation` (beta)

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label May 21, 2025
@ramonvermeulen ramonvermeulen changed the title feat: add scaling_mode property to google_bigquery_reservation feat: added support for scaling_mode and max_slots properties to google_bigquery_reservation May 21, 2025
@ramonvermeulen ramonvermeulen changed the title feat: added support for scaling_mode and max_slots properties to google_bigquery_reservation feat: added support for scaling_mode and max_slots properties to google_bigquery_reservation (google-beta) May 21, 2025
@ramonvermeulen ramonvermeulen force-pushed the ramon/22947-bigquery-slot-reservation-scaling-mode branch from 514948a to a763b37 Compare May 21, 2025 19:59
@ramonvermeulen
Copy link
Contributor Author

ramonvermeulen commented May 21, 2025

Note, the added tests required me to enable the enable_reservation_based_fairness config option for my google project (not sure if this is enabled in the CI?).

Otherwise you will run into the following error:

❯ make testacc TEST=./google-beta/services/bigqueryreservation TESTARGS='-run=TestAccBigqueryReservation_withScalingMode_update'

==> Checking that code complies with gofmt requirements...
go vet
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google-beta/services/bigqueryreservation -v -run=TestAccBigqueryReservation_withScalingMode_update -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google-beta/version.ProviderVersion=acc"
=== RUN   TestAccBigqueryReservation_withScalingMode_update
=== PAUSE TestAccBigqueryReservation_withScalingMode_update
=== CONT  TestAccBigqueryReservation_withScalingMode_update
    resource_bigquery_reservation_test.go:50: Step 1/4 error: Error running apply: exit status 1

        Error: Error creating Reservation: googleapi: Error 400: Cannot use max slots without enabling reservation-based fairness.

          with google_bigquery_reservation.reservation,
          on terraform_plugin_test.tf line 2, in resource "google_bigquery_reservation" "reservation":
           2: resource "google_bigquery_reservation" "reservation" {

--- FAIL: TestAccBigqueryReservation_withScalingMode_update (1.60s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-google-beta/google-beta/services/bigqueryreservation    2.312s
FAIL
make: *** [testacc] Error 1

Test run after enabling enable_reservation_based_fairness:

❯ make testacc TEST=./google-beta/services/bigqueryreservation TESTARGS='-run=TestAccBigqueryReservation_withScalingMode_update'

==> Checking that code complies with gofmt requirements...
go vet
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google-beta/services/bigqueryreservation -v -run=TestAccBigqueryReservation_withScalingMode_update -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google-beta/version.ProviderVersion=acc"
=== RUN   TestAccBigqueryReservation_withScalingMode_update
=== PAUSE TestAccBigqueryReservation_withScalingMode_update
=== CONT  TestAccBigqueryReservation_withScalingMode_update
--- PASS: TestAccBigqueryReservation_withScalingMode_update (9.21s)
PASS
ok      github.com/hashicorp/terraform-provider-google-beta/google-beta/services/bigqueryreservation    9.938s

And full test run:

❮ make testacc TEST=./google-beta/services/bigqueryreservation TESTARGS='-run=TestAccBigqueryReservation_'

==> Checking that code complies with gofmt requirements...
go vet
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google-beta/services/bigqueryreservation -v -run=TestAccBigqueryReservation_ -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google-beta/version.ProviderVersion=acc"
=== RUN   TestAccBigqueryReservation_withDisasterRecovery_update
=== PAUSE TestAccBigqueryReservation_withDisasterRecovery_update
=== RUN   TestAccBigqueryReservation_withScalingMode_update
=== PAUSE TestAccBigqueryReservation_withScalingMode_update
=== CONT  TestAccBigqueryReservation_withDisasterRecovery_update
=== CONT  TestAccBigqueryReservation_withScalingMode_update
--- PASS: TestAccBigqueryReservation_withScalingMode_update (8.95s)
--- PASS: TestAccBigqueryReservation_withDisasterRecovery_update (9.04s)
PASS
ok      github.com/hashicorp/terraform-provider-google-beta/google-beta/services/bigqueryreservation    9.788s

@ramonvermeulen ramonvermeulen marked this pull request as ready for review May 21, 2025 20:00
@github-actions github-actions bot requested a review from hao-nan-li May 21, 2025 20:01
Copy link

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.

@hao-nan-li, 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.

@ramonvermeulen ramonvermeulen changed the title feat: added support for scaling_mode and max_slots properties to google_bigquery_reservation (google-beta) feat: added support for scaling_mode and max_slots properties for google_bigquery_reservation (google-beta) May 21, 2025
@ramonvermeulen ramonvermeulen changed the title feat: added support for scaling_mode and max_slots properties for google_bigquery_reservation (google-beta) feat: added support for scaling_mode and max_slots properties on google_bigquery_reservation (google-beta) May 21, 2025
@ramonvermeulen ramonvermeulen changed the title feat: added support for scaling_mode and max_slots properties on google_bigquery_reservation (google-beta) bigqueryreservation: added support for scaling_mode and max_slots properties on google_bigquery_reservation (beta) May 21, 2025
@modular-magician modular-magician added service/bigquery and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels May 22, 2025
@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, 72 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 4 files changed, 301 insertions(+), 1 deletion(-))
terraform-google-conversion: Diff ( 1 file changed, 20 insertions(+))

@modular-magician modular-magician requested a review from wj-chen May 22, 2025 16:12
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 11
Passed tests: 10
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • bigqueryreservation
#### 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
  • TestAccBigqueryReservation_withScalingMode_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

@wj-chen wj-chen left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! @hao-nan-li could help set the new config in the test projects unless there are concerns.

@hao-nan-li
Copy link
Contributor

Just want to make sure, to enable_reservation_based_fairness, is that a project setting, or a permission setting to a service account?

@wj-chen
Copy link
Member

wj-chen commented May 23, 2025

Just want to make sure, to enable_reservation_based_fairness, is that a project setting, or a permission setting to a service account?

That is a project-level config. The documentation link has more details.

Copy link

@hao-nan-li 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

@GoogleCloudPlatform/terraform-team @hao-nan-li This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link

github-actions bot commented Jun 4, 2025

@GoogleCloudPlatform/terraform-team @hao-nan-li This PR has been waiting for review for 2 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link

@GoogleCloudPlatform/terraform-team @hao-nan-li This PR has been waiting for review for 3 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Jun 16, 2025
@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, 72 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 4 files changed, 301 insertions(+), 1 deletion(-))
terraform-google-conversion: Diff ( 1 file changed, 20 insertions(+))

@modular-magician modular-magician requested a review from wj-chen June 16, 2025 20:11
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 11
Passed tests: 10
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • bigqueryreservation
#### 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
  • TestAccBigqueryReservation_withScalingMode_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

@GoogleCloudPlatform/terraform-team @hao-nan-li This PR has been waiting for review for 4 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link

@GoogleCloudPlatform/terraform-team @hao-nan-li This PR has been waiting for review for 5 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link

github-actions bot commented Jul 2, 2025

@GoogleCloudPlatform/terraform-team @hao-nan-li This PR has been waiting for review for 6 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

@ramonvermeulen
Copy link
Contributor Author

Just want to make sure, to enable_reservation_based_fairness, is that a project setting, or a permission setting to a service account?

That is a project-level config. The documentation link has more details.

Any status update on setting this project level config for the CI in the meantime?

@hao-nan-li
Copy link
Contributor

Just want to make sure, to enable_reservation_based_fairness, is that a project setting, or a permission setting to a service account?

That is a project-level config. The documentation link has more details.

Any status update on setting this project level config for the CI in the meantime?

I tried to enable it and it's not too straight forward, could someone help for the test setup?

@wj-chen
Copy link
Member

wj-chen commented Jul 7, 2025

Just want to make sure, to enable_reservation_based_fairness, is that a project setting, or a permission setting to a service account?

That is a project-level config. The documentation link has more details.

Any status update on setting this project level config for the CI in the meantime?

I tried to enable it and it's not too straight forward, could someone help for the test setup?

Could you share more info on what error you saw when trying to enable the setting?

@hao-nan-li
Copy link
Contributor

Just want to make sure, to enable_reservation_based_fairness, is that a project setting, or a permission setting to a service account?

That is a project-level config. The documentation link has more details.

Any status update on setting this project level config for the CI in the meantime?

I tried to enable it and it's not too straight forward, could someone help for the test setup?

Could you share more info on what error you saw when trying to enable the setting?

I created a predictable reservation with the ID reservationtest, does that help?

Copy link

github-actions bot commented Jul 9, 2025

@GoogleCloudPlatform/terraform-team @hao-nan-li This PR has been waiting for review for 7 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link

@GoogleCloudPlatform/terraform-team @hao-nan-li This PR has been waiting for review for 8 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

@wj-chen
Copy link
Member

wj-chen commented Jul 18, 2025

Just want to make sure, to enable_reservation_based_fairness, is that a project setting, or a permission setting to a service account?

That is a project-level config. The documentation link has more details.

Any status update on setting this project level config for the CI in the meantime?

I tried to enable it and it's not too straight forward, could someone help for the test setup?

Could you share more info on what error you saw when trying to enable the setting?

I created a predictable reservation with the ID reservationtest, does that help?

@hao-nan-li To enable the test in this PR to run, we need to set enable_reservation_based_fairness = true in the region of the reservation. Since you were able to create a predictable reservation, you must have already run the ALTER PROJECT ... SET OPTIONS ... statement. Was it in project ci-test-project-188019, and in region us-west2 (specified in this PR). If it was a different region, we can either run the ALTER PROJECT on us-west2 again, or update the test in this PR to use whatever region you already set the option for. Otherwise, we shouldn't need any static reservation to remain in this project for this test, just the project-level setting.

Copy link

@GoogleCloudPlatform/terraform-team @hao-nan-li This PR has been waiting for review for 9 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

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.

support bigquery reservation predictability
4 participants