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

feat(vertexai): add parameter region to google_vertex_ai_featurestore_entitytype_feature #6992

Conversation

shotarok
Copy link
Contributor

@shotarok shotarok commented Dec 19, 2022

fixes hashicorp/terraform-provider-google#13217.

This PR will make google_vertex_ai_featurestore_entitytype_feature always use regional endpoint corresponding to parent's region. This will prevent the error: "Cannot determine region: set in this resource, or set provider-level 'region' or 'zone'" from happening.

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

Release Note Template for Downstream PRs (will be copied)

vertexai: made google_vertex_ai_featurestore_entitytype_feature always use regional corresponding to parent's region

@modular-magician
Copy link
Collaborator

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

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

❓ 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
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 ( 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
Copy link
Collaborator

Tests analytics

Total tests: 2354
Passed tests 2105
Skipped tests: 247
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
TestAccContainerCluster_withInvalidGatewayApiConfigChannel|TestAccLoggingBucketConfigProject_cmekSettings

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccContainerCluster_withInvalidGatewayApiConfigChannel[Debug log]
TestAccLoggingBucketConfigProject_cmekSettings[Debug log]

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

@shotarok shotarok marked this pull request as ready for review December 19, 2022 01:41
Copy link
Contributor

@roaks3 roaks3 left a comment

Choose a reason for hiding this comment

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

I made some comments here to make sure that this solution is correct, but I also left a comment on the issue that it is resolving. I'd like to confirm that this is not a breaking change, and does not have other implications.


entitytype := d.Get("entitytype").(string)

re := regexp.MustCompile("^projects/(.+)/locations/(.+)/featurestores/(.+)$")
Copy link
Contributor

Choose a reason for hiding this comment

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

Would we want to validate that the entity type also includes entityTypes/, or am I misunderstanding this logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The purpose of the regex is just to extract the <location> from projects/<project name>/locations/<location>/featurestores/<featurestore name>/entityTypes/<entitytype name>.

I didn't intend to validate the id of entity type here, but adding the validation sounds good to me. So I'll update the regex. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated it in 047a83b.

@@ -0,0 +1,8 @@
if v, ok := d.GetOk("entitytype"); ok {
re := regexp.MustCompile("projects/(.+)/locations/(.+)/featurestores/(.+)$")
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question as above, do we need entityTypes?

Copy link
Contributor Author

@shotarok shotarok Jun 2, 2023

Choose a reason for hiding this comment

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

I've updated it in 047a83b and fc0ff8c

@mahvar
Copy link

mahvar commented Feb 10, 2023

I face a similar issue using google_vertex_ai_endpoint:

Error: Cannot determine region: set in this resource, or set provider-level 'region' or 'zone'.

This is the version using:

Terraform v1.3.7
on darwin_arm64

  • provider registry.terraform.io/hashicorp/google v3.63.0
  • provider registry.terraform.io/hashicorp/google-beta v4.52.0

What's the remedy?

@roaks3
Copy link
Contributor

roaks3 commented May 23, 2023

@shotarok lightly pinging this one. The PR has been open for quite a while now; could we try to move it forward or close it?

@shotarok
Copy link
Contributor Author

@roaks3 (CC: @mahvar) Sorry for keeping this PR open for a long time. I'll check out this PR and the original issue too

@mahvar
Copy link

mahvar commented May 24, 2023 via email

@shotarok
Copy link
Contributor Author

I haven't fixed the problem of the featurestore_entitytype_feature yet, but that's good to know the similar issue of google_vertex_ai_endpoint was resolved!

@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Jun 2, 2023
@shotarok
Copy link
Contributor Author

shotarok commented Jun 2, 2023

@roaks3 I've updated the code and replied to the comments. Could you take a look when you have time?

I'd like to confirm that this is not a breaking change, and does not have other implications.

I believe this PR is a bug fix, not a breaking change as the issue labels indicate (hashicorp/terraform-provider-google#13217). Please let me know if there are any concerns.


[UPDATED] I pushed two additional commits because I found unintentional changes

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

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2774
Passed tests 2483
Skipped tests: 285
Affected tests: 6

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
TestAccLoggingBucketConfigProject_cmekSettings|TestAccComputeFirewallPolicyRule_multipleRules|TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample|TestAccApigeeKeystoresAliasesPkcs12_ApigeeKeystoresAliasesPkcs12Example|TestAccDataSourceAlloydbLocations_basic|TestAccDataSourceGoogleFirebaseAndroidAppConfig

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample[Debug log]
TestAccApigeeKeystoresAliasesPkcs12_ApigeeKeystoresAliasesPkcs12Example[Debug log]
TestAccDataSourceAlloydbLocations_basic[Debug log]
TestAccDataSourceGoogleFirebaseAndroidAppConfig[Debug log]

Tests failed during RECORDING mode:
TestAccLoggingBucketConfigProject_cmekSettings[Error message] [Debug log]
TestAccComputeFirewallPolicyRule_multipleRules[Error message] [Debug log]

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

@shotarok shotarok deleted the extract-region-from-entitytype-on-feature branch June 12, 2023 20:15
codding-buddha pushed a commit to codding-buddha/magic-modules that referenced this pull request Jun 14, 2023
…ore_entitytype_feature` (GoogleCloudPlatform#6992)

* feat: add parameter region to google_vertex_ai_featurestore_entitytype_feature

* feat: update code to use tpgresource and transport_tpg

* fix: update a description of the field

* refactor: update regex to validate id of an entity type

* fix: remove an no longer used yaml file

* fix: fix the files to update the regex
ericayyliu pushed a commit to ericayyliu/magic-modules that referenced this pull request Jul 26, 2023
…ore_entitytype_feature` (GoogleCloudPlatform#6992)

* feat: add parameter region to google_vertex_ai_featurestore_entitytype_feature

* feat: update code to use tpgresource and transport_tpg

* fix: update a description of the field

* refactor: update regex to validate id of an entity type

* fix: remove an no longer used yaml file

* fix: fix the files to update the regex
wj-chen pushed a commit to wj-chen/magic-modules that referenced this pull request Aug 1, 2023
…ore_entitytype_feature` (GoogleCloudPlatform#6992)

* feat: add parameter region to google_vertex_ai_featurestore_entitytype_feature

* feat: update code to use tpgresource and transport_tpg

* fix: update a description of the field

* refactor: update regex to validate id of an entity type

* fix: remove an no longer used yaml file

* fix: fix the files to update the regex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants