magic-modules icon indicating copy to clipboard operation
magic-modules copied to clipboard

fix: added parameter region to google_vertex_ai_featurestore_entitytype

Open gericdong opened this issue 2 years ago • 6 comments

fixes {https://github.com/hashicorp/terraform-provider-google/issues/10100} : "google_vertex_ai_featurestore_entitytype: Cannot determine region: set in this resource, or set provider-level 'region' or 'zone' #10100.

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

  • [x] 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).
  • [x] Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • [x] 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).
  • [x] Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • [x] Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

vertex_ai:  added parameter region to google_vertex_ai_featurestore_entitytype to address bug #10100 ""google_vertex_ai_featurestore_entitytype: Cannot determine region: set in this resource, or set provider-level 'region' or 'zone'"

gericdong avatar Sep 21 '22 20:09 gericdong

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

  • bug fix for #10100: https://github.com/hashicorp/terraform-provider-google/issues/10100}

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

modular-magician avatar Sep 21 '22 20:09 modular-magician

Hello! I am a robot who works on Magic Modules PRs.

I've detected that you're a community contributor. @melinath, a repository maintainer, has been assigned to assist you and help review your changes.

:question: 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.


modular-magician avatar Sep 21 '22 20:09 modular-magician

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

Diff report:

Terraform GA: Diff ( 1 file changed, 4 insertions(+)) Terraform Beta: Diff ( 3 files changed, 12 insertions(+), 1 deletion(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Sep 21 '22 20:09 modular-magician

Tests analytics

Total tests: 2176 Passed tests 1934 Skipped tests: 238 Failed tests: 4

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccComputeInstance_soleTenantNodeAffinities|TestAccComputeForwardingRule_update|TestAccCGCSnippet_eventarcWorkflowsExample|TestAccFirebaserulesRelease_BasicRelease

modular-magician avatar Sep 21 '22 21:09 modular-magician

Tests passed during RECORDING mode: TestAccComputeForwardingRule_update[Debug log] TestAccFirebaserulesRelease_BasicRelease[Debug log]

Tests failed during RECORDING mode: TestAccComputeInstance_soleTenantNodeAffinities[Error message] [Debug log] TestAccCGCSnippet_eventarcWorkflowsExample[Error message] [Debug log]

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

modular-magician avatar Sep 21 '22 21:09 modular-magician

/gcbrun

gericdong avatar Sep 22 '22 12:09 gericdong

I see that featurestore uses a region field to store the location; that should be irrelevant from the perspective of the entitytype resource.

melinath avatar Sep 26 '22 22:09 melinath

Looked into this briefly - the issue is that VertexAIBasePath gets recursively replaced with something that expects a {{region}} field: https://github.com/hashicorp/terraform-provider-google-beta/blob/37b98fbd47237e80cedf2c9dd102fb71cd351fb5/google-beta/config.go#L451

Fixing this will likely require refactoring internals of the magic modules compiler.

melinath avatar Sep 27 '22 21:09 melinath

the above suggestion doesn't work because this resource also doesn't have a location field - the location is included as part of the parent resource field (featurestore).

melinath avatar Oct 20 '22 16:10 melinath

Apologies for the delay. Here is a path forward:

  1. use extra_schema_entry to add a region field. Make sure that the field is marked as output-only.
  2. Add a custom_code.encoder entry.
  3. Inside the custom encoder, all you need to do (I believe) is return the obj and call d.Set("region", valueextractedfromid)

Similar fix: https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/templates/terraform/encoders/redis_location_id_for_fallback_zone.go.erb

melinath avatar Nov 02 '22 18:11 melinath

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 ( 1 file changed, 26 insertions(+)) Terraform Beta: Diff ( 1 file changed, 26 insertions(+)) TF Validator: Diff ( 3 files changed, 18 insertions(+), 4 deletions(-))

modular-magician avatar Nov 03 '22 13:11 modular-magician

Tests analytics

Total tests: 2215 Passed tests 1974 Skipped tests: 239 Failed tests: 2

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeWithBetaFieldsExample|TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeExample

modular-magician avatar Nov 03 '22 14:11 modular-magician

Tests failed during RECORDING mode: TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeWithBetaFieldsExample[Error message] [Debug log] TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeExample[Error message] [Debug log]

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

modular-magician avatar Nov 03 '22 14:11 modular-magician

It looks like you also need to make sure that Import sets the region field. I think that'll require a custom_code.custom_import override. Basically: copy the existing import code and then add a few lines to match what you're doing in the encoder.

melinath avatar Nov 03 '22 15:11 melinath

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 ( 1 file changed, 34 insertions(+), 8 deletions(-)) Terraform Beta: Diff ( 1 file changed, 34 insertions(+), 8 deletions(-)) TF Validator: Diff ( 3 files changed, 18 insertions(+), 4 deletions(-))

modular-magician avatar Nov 03 '22 17:11 modular-magician

The provider crashed while running the VCR tests in REPLAYING mode Please fix it to complete your PR View the build log

modular-magician avatar Nov 03 '22 18:11 modular-magician

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 ( 1 file changed, 34 insertions(+), 8 deletions(-)) Terraform Beta: Diff ( 1 file changed, 34 insertions(+), 8 deletions(-)) TF Validator: Diff ( 3 files changed, 18 insertions(+), 4 deletions(-))

modular-magician avatar Nov 03 '22 19:11 modular-magician

Tests analytics

Total tests: 2215 Passed tests 1974 Skipped tests: 239 Failed tests: 2

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeExample|TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeWithBetaFieldsExample

modular-magician avatar Nov 03 '22 19:11 modular-magician

Tests failed during RECORDING mode: TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeExample[Error message] [Debug log] TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeWithBetaFieldsExample[Error message] [Debug log]

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

modular-magician avatar Nov 03 '22 19:11 modular-magician

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 ( 1 file changed, 35 insertions(+), 8 deletions(-)) Terraform Beta: Diff ( 1 file changed, 35 insertions(+), 8 deletions(-)) TF Validator: Diff ( 3 files changed, 18 insertions(+), 4 deletions(-))

modular-magician avatar Nov 03 '22 21:11 modular-magician

Tests analytics

Total tests: 2216 Passed tests 1973 Skipped tests: 239 Failed tests: 4

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeWithBetaFieldsExample|TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeExample|TestAccFirebaserulesRelease_BasicRelease|TestAccComputeForwardingRule_update

modular-magician avatar Nov 03 '22 22:11 modular-magician

Tests passed during RECORDING mode: TestAccFirebaserulesRelease_BasicRelease[Debug log] TestAccComputeForwardingRule_update[Debug log]

Tests failed during RECORDING mode: TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeWithBetaFieldsExample[Error message] [Debug log] TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeExample[Error message] [Debug log]

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

modular-magician avatar Nov 03 '22 22:11 modular-magician

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 ( 1 file changed, 34 insertions(+), 6 deletions(-)) Terraform Beta: Diff ( 1 file changed, 34 insertions(+), 6 deletions(-)) TF Validator: Diff ( 3 files changed, 18 insertions(+), 4 deletions(-))

modular-magician avatar Nov 04 '22 01:11 modular-magician

The provider crashed while running the VCR tests in REPLAYING mode Please fix it to complete your PR View the build log

modular-magician avatar Nov 04 '22 01:11 modular-magician

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 ( 1 file changed, 34 insertions(+), 8 deletions(-)) Terraform Beta: Diff ( 1 file changed, 34 insertions(+), 8 deletions(-)) TF Validator: Diff ( 3 files changed, 18 insertions(+), 4 deletions(-))

modular-magician avatar Nov 04 '22 03:11 modular-magician

Tests analytics

Total tests: 2216 Passed tests 1974 Skipped tests: 239 Failed tests: 3

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccFirebaserulesRelease_BasicRelease|TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeWithBetaFieldsExample|TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeExample

modular-magician avatar Nov 04 '22 03:11 modular-magician

Tests passed during RECORDING mode: TestAccFirebaserulesRelease_BasicRelease[Debug log]

Tests failed during RECORDING mode: TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeWithBetaFieldsExample[Error message] [Debug log] TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeExample[Error message] [Debug log]

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

modular-magician avatar Nov 04 '22 03:11 modular-magician

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 ( 1 file changed, 33 insertions(+)) Terraform Beta: Diff ( 1 file changed, 33 insertions(+)) TF Validator: Diff ( 3 files changed, 18 insertions(+), 4 deletions(-))

modular-magician avatar Nov 04 '22 18:11 modular-magician

Tests analytics

Total tests: 2216 Passed tests 1976 Skipped tests: 239 Failed tests: 1

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccFirebaserulesRelease_BasicRelease

modular-magician avatar Nov 04 '22 19:11 modular-magician

Tests passed during RECORDING mode: TestAccFirebaserulesRelease_BasicRelease[Debug log]

All tests passed View the build log or the debug log for each test

modular-magician avatar Nov 04 '22 19:11 modular-magician