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

add scaling_config to google_dataproc_metastore_service resource in google #8526

Merged
merged 6 commits into from
Aug 11, 2023

Conversation

vicenteg
Copy link
Contributor

@vicenteg vicenteg commented Aug 2, 2023

This PR adds the scaling_config field to the google_dataproc_metastore_service beta resource. This PR fixes 15342

The scaling_config field enables the user to create a DPMS2 service using Terraform.

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).
  • 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).
  • Generated Terraform providers, and ran make test and make lint in the generated providers to ensure it passes unit and linter tests.
  • Ran relevant acceptance tests using my own Google Cloud project and credentials (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read Write release notes before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

dataproc_metastore: added `scaling_config` field to `google_dataproc_metastore_service` resource

@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a community contributor. @slevenick, 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
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 ( 3 files changed, 215 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 3 files changed, 215 insertions(+), 5 deletions(-))
TF Conversion: Diff ( 3 files changed, 43 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 4 files changed, 122 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_dataproc_metastore_service (17 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_dataproc_metastore_service" "primary" {
  scaling_config {
    scaling_factor = # value needed
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2923
Passed tests 2620
Skipped tests: 302
Affected tests: 1

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
TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2Example

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2Example[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@@ -0,0 +1,21 @@
resource "google_dataproc_metastore_service" "<%= ctx[:primary_resource_id] %>" {
service_id = "<%= ctx[:vars]['metastore_service_name'] %>"
provider = google-beta
Copy link
Contributor

Choose a reason for hiding this comment

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

This should only be present if the field is beta-only

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, resolved in commit 7b02a51.

Currently failing for fractional values:

$ make testacc TEST=./google-beta TESTARGS='-v -run=TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example'
==> Checking that code complies with gofmt requirements...
go vet
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google-beta -v -v -run=TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google-beta/version.ProviderVersion=acc"
=== RUN   TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example
=== PAUSE TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example
=== CONT  TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example
    vcr_utils.go:152: Step 1/2 error: Error running pre-apply refresh: exit status 1

        Error: Attribute must be a whole number, got 1.1

          with google_dataproc_metastore_service.dpms2_scaling_factor_lt1,
          on terraform_plugin_test.tf line 20, in resource "google_dataproc_metastore_service" "dpms2_scaling_factor_lt1":
          20:     scaling_factor = "1.1"

--- FAIL: TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example (1.50s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-google-beta/google-beta 1.964s
FAIL
make: *** [GNUmakefile:15: testacc] Error 1
@vicenteg
Copy link
Contributor Author

vicenteg commented Aug 4, 2023

@nitikhadapkar @slevenick

I'm struggling with a test, and would appreciate a second set of eyes. When I pass a fractional value to scaling_factor, terraform complains because it is not a whole number. I've tried changing the type in the magic module to a String, and a Double, but the result is the same:

➜  terraform-provider-google-beta git:(main) ✗ make testacc TEST=./google-beta TESTARGS='-v -run=TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example'
==> Checking that code complies with gofmt requirements...
go vet
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google-beta -v -v -run=TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google-beta/version.ProviderVersion=acc"
=== RUN   TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example
=== PAUSE TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example
=== CONT  TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example
    vcr_utils.go:152: Step 1/2 error: Error running pre-apply refresh: exit status 1
        
        Error: Attribute must be a whole number, got 1.1
        
          with google_dataproc_metastore_service.dpms2_scaling_factor_lt1,
          on terraform_plugin_test.tf line 20, in resource "google_dataproc_metastore_service" "dpms2_scaling_factor_lt1":
          20:     scaling_factor = "1.1"
        
--- FAIL: TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example (1.50s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-google-beta/google-beta 1.964s
FAIL
make: *** [GNUmakefile:15: testacc] Error 1

Searching shows that this error ("Attribute must be a whole number") most often shows up when using a 32-bit terraform binary, but I've confirmed I have a 64 bit Go and a 64 bit terraform installed on my linux system. I'm unsure how to troubleshoot this further.

I've considered removing the scaling_factor field, but that would not allow for as granular control of the scaling of the service.

@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 ( 3 files changed, 335 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 3 files changed, 335 insertions(+), 5 deletions(-))
TF Conversion: Diff ( 3 files changed, 43 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 12 files changed, 366 insertions(+))

@vicenteg
Copy link
Contributor Author

vicenteg commented Aug 4, 2023

Error: Attribute must be a whole number, got 1.1

Looks like this is only an issue with google-beta not with google.

make testacc TEST=./google TESTARGS='-v -run=TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example'
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google -v -v -run=TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google/version.ProviderVersion=acc"
=== RUN   TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example
=== PAUSE TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example
=== CONT  TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example
--- PASS: TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example (1162.65s)
PASS
ok      github.com/hashicorp/terraform-provider-google/google   1163.079s

- removed google-beta provider
- removed fields from tests that require google-beta provider (gRPC)
@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 ( 3 files changed, 310 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 3 files changed, 310 insertions(+), 5 deletions(-))
TF Conversion: Diff ( 3 files changed, 43 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 12 files changed, 351 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2933
Passed tests 2628
Skipped tests: 302
Affected tests: 3

Action taken

Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example|TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorExample|TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2Example

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorLt1Example[Debug log]
TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorExample[Debug log]
TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2Example[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}
View the build log or the debug log for each test

@vicenteg vicenteg marked this pull request as ready for review August 4, 2023 18:14
@vicenteg vicenteg changed the title add scaling_config to google_dataproc_metastore_service resource in google-beta add scaling_config to google_dataproc_metastore_service resource in google Aug 8, 2023
@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 ( 3 files changed, 311 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 3 files changed, 311 insertions(+), 5 deletions(-))
TF Conversion: Diff ( 3 files changed, 43 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 12 files changed, 351 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2942
Passed tests 2640
Skipped tests: 302
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

@slevenick slevenick merged commit 7aca11d into GoogleCloudPlatform:main Aug 11, 2023
18 checks passed
SamGerber pushed a commit to SamGerber/magic-modules that referenced this pull request Aug 14, 2023
…oogle (GoogleCloudPlatform#8526)

* add scalingConfig object for google_dataproc_metastore_service

* add an example of a DPMS 2 config

* remove invalid value for instanceSize

* WIP: Add tests for scaling_factor

* changes for ga provider

- removed google-beta provider
- removed fields from tests that require google-beta provider (gRPC)

* add exactly_one_of for instance_size and scaling_factor
DanielRieske pushed a commit to DanielRieske/magic-modules that referenced this pull request Aug 15, 2023
…oogle (GoogleCloudPlatform#8526)

* add scalingConfig object for google_dataproc_metastore_service

* add an example of a DPMS 2 config

* remove invalid value for instanceSize

* WIP: Add tests for scaling_factor

* changes for ga provider

- removed google-beta provider
- removed fields from tests that require google-beta provider (gRPC)

* add exactly_one_of for instance_size and scaling_factor
nevzheng pushed a commit to nevzheng/magic-modules that referenced this pull request Aug 16, 2023
…oogle (GoogleCloudPlatform#8526)

* add scalingConfig object for google_dataproc_metastore_service

* add an example of a DPMS 2 config

* remove invalid value for instanceSize

* WIP: Add tests for scaling_factor

* changes for ga provider

- removed google-beta provider
- removed fields from tests that require google-beta provider (gRPC)

* add exactly_one_of for instance_size and scaling_factor
ron-gal pushed a commit to ron-gal/magic-modules that referenced this pull request Aug 17, 2023
…oogle (GoogleCloudPlatform#8526)

* add scalingConfig object for google_dataproc_metastore_service

* add an example of a DPMS 2 config

* remove invalid value for instanceSize

* WIP: Add tests for scaling_factor

* changes for ga provider

- removed google-beta provider
- removed fields from tests that require google-beta provider (gRPC)

* add exactly_one_of for instance_size and scaling_factor
rainshen49 pushed a commit to rainshen49/magic-modules that referenced this pull request Aug 21, 2023
…oogle (GoogleCloudPlatform#8526)

* add scalingConfig object for google_dataproc_metastore_service

* add an example of a DPMS 2 config

* remove invalid value for instanceSize

* WIP: Add tests for scaling_factor

* changes for ga provider

- removed google-beta provider
- removed fields from tests that require google-beta provider (gRPC)

* add exactly_one_of for instance_size and scaling_factor
joelkattapuram pushed a commit to joelkattapuram/magic-modules that referenced this pull request Sep 20, 2023
…oogle (GoogleCloudPlatform#8526)

* add scalingConfig object for google_dataproc_metastore_service

* add an example of a DPMS 2 config

* remove invalid value for instanceSize

* WIP: Add tests for scaling_factor

* changes for ga provider

- removed google-beta provider
- removed fields from tests that require google-beta provider (gRPC)

* add exactly_one_of for instance_size and scaling_factor
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.

google_dataproc_metastore_service should support scalingConfig, enabling DPMS 2
4 participants