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: add IAM resources for Vertex AI Endpoints #7965

Closed

Conversation

ghost
Copy link

@ghost ghost commented May 17, 2023

Fixes hashicorp/terraform-provider-google#14630

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 the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

vertexai: Added IAM resources for google_vertex_ai_endpoint

@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. @slevenick, 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 modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label May 17, 2023
@ghost ghost force-pushed the feat/vertex_endpoint_iam branch from a752585 to 66a1763 Compare May 17, 2023 13:53
@ghost
Copy link
Author

ghost commented May 19, 2023

hi @slevenick! I have now run the unit tests for vertexai and make lint successfully. Not sure what acceptance tests to run - are there specific ones to check for new IAM resources? Thanks

@ghost
Copy link
Author

ghost commented Aug 2, 2023

@slevenick would you be able to take a look at this?

@slevenick
Copy link
Contributor

Sorry I must have missed this originally. Can you rebase this from current main? Our CI is having trouble running it as it's too old

@ghost ghost force-pushed the feat/vertex_endpoint_iam branch from 66a1763 to d97e370 Compare August 2, 2023 15:31
@ghost
Copy link
Author

ghost commented Aug 2, 2023

done!

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Aug 2, 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, 219 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 4 files changed, 468 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 5 files changed, 377 insertions(+), 3 deletions(-))

Missing test report

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

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

resource "google_vertex_ai_endpoint_iam_binding" "primary" {
  condition {
    description = # value needed
    expression  = # value needed
    title       = # value needed
  }
  endpoint = # value needed
  location = # value needed
  members  = # value needed
  role     = # value needed
}

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

resource "google_vertex_ai_endpoint_iam_member" "primary" {
  condition {
    description = # value needed
    expression  = # value needed
    title       = # value needed
  }
  endpoint = # value needed
  location = # value needed
  member   = # value needed
  role     = # value needed
}

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

resource "google_vertex_ai_endpoint_iam_policy" "primary" {
  endpoint    = # value needed
  location    = # value needed
  policy_data = # value needed
}

@slevenick
Copy link
Contributor

Tests seem not to be generating. Looks like it's because we skip the only test in the vertex AI endpoints resource.

Can we unmark the test as skip_test to see if that will generate the IAM resource tests?

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2917
Passed tests 2615
Skipped tests: 302
Affected tests: 0

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

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Aug 3, 2023
@ghost
Copy link
Author

ghost commented Aug 4, 2023

@slevenick done!

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Aug 4, 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 ( 5 files changed, 367 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 7 files changed, 1037 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 5 files changed, 377 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 1 file changed, 2 insertions(+))

Missing test report

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

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

resource "google_vertex_ai_endpoint_iam_binding" "primary" {
  condition {
    description = # value needed
    expression  = # value needed
    title       = # value needed
  }
  location = # value needed
}

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

resource "google_vertex_ai_endpoint_iam_member" "primary" {
  condition {
    description = # value needed
    expression  = # value needed
    title       = # value needed
  }
  location = # value needed
}

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

resource "google_vertex_ai_endpoint_iam_policy" "primary" {
  location = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 13
Passed tests 13
Skipped tests: 0
Affected tests: 0

$\textcolor{red}{\textsf{Errors occurred during REPLAYING mode. Please fix them to complete your PR}}$
View the build log

@slevenick
Copy link
Contributor

/gcbrun
Huh... I'm not super sure why this failed

I'll try kicking it off again

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Aug 4, 2023
@slevenick
Copy link
Contributor

Oh no, I see it:

google/resource_vertex_ai_endpoint_test.go:150:6: testAccCheckVertexAIEndpointDestroyProducer redeclared in this block

We may need to go back to skipping the test and hand-writing a test for the IAM resources specifically. You can use the generated test in the previous diff as a starting place for that, because it should do all of what we need

@ghost
Copy link
Author

ghost commented Aug 9, 2023

@slevenick is this what you had in mind for the handwritten test? (I am still pretty new to magic modules!)

@ghost
Copy link
Author

ghost commented Aug 16, 2023

@slevenick is anything more needed for this PR?

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Aug 16, 2023
Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

Sorry, there were some folder changes recently, you may need to rebase and move the handwritten file.

CONFLICT (file location): mmv1/third_party/terraform/tests/iam_vertex_endpoint_test.go.erb added in head/feat/vertex_endpoint_iam inside a directory that was renamed in HEAD, suggesting it should perhaps be moved to mmv1/third_party/terraform/services/compute/iam_vertex_endpoint_test.go.erb.

compute is the wrong suggestion though.

@ghost ghost force-pushed the feat/vertex_endpoint_iam branch from 818fc2a to 8a21b96 Compare August 16, 2023 14:15
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Aug 16, 2023
@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Aug 16, 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 ( 4 files changed, 232 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 874 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 3 files changed, 374 insertions(+))

@@ -0,0 +1,407 @@
<% autogen_exception -%>
package google
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the package is different now to match vertexai

@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 Aug 17, 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 ( 4 files changed, 232 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 874 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 3 files changed, 374 insertions(+))

Missing test report

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

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

resource "google_vertex_ai_endpoint_iam_binding" "primary" {
  condition {
    description = # value needed
    expression  = # value needed
    title       = # value needed
  }
  location = # value needed
}

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

resource "google_vertex_ai_endpoint_iam_member" "primary" {
  condition {
    description = # value needed
    expression  = # value needed
    title       = # value needed
  }
  location = # value needed
}

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

resource "google_vertex_ai_endpoint_iam_policy" "primary" {
  location = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2936
Passed tests 2633
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
TestAccDataSourceGoogleServiceAccountIdToken_impersonation

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

Rerun these tests in REPLAYING mode to catch issues

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


$\textcolor{red}{\textsf{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
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

Compilation failure at:
google-beta/services/vertexai/iam_vertex_endpoint_test.go:32:24: fmt.Sprintf format %s reads arg #3, but call has 2 args

Copy link

@ghost, this PR is waiting for action from you. Please address any comments or change requests, or re-request review from a core reviewer if no action is required.

Image showing the re-request review button

If no action is taken, this PR will be closed in 14 days.

This notification can be disabled with the disable-automatic-closure label.

@slevenick slevenick closed this May 29, 2024
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.

Add IAM resources for Vertex AI Endpoints
2 participants