-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Adding IAM support in Terraform for Dataform Repository resource #9457
Conversation
Hello! I am a robot. It looks like you are a: @SarahFrench, 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. |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 2 files changed, 220 insertions(+)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_dataform_repository_iam_binding" "primary" {
condition {
description = # value needed
expression = # value needed
title = # value needed
}
}
Resource: resource "google_dataform_repository_iam_member" "primary" {
condition {
description = # value needed
expression = # value needed
title = # value needed
}
}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @maverickjoy , thanks for your contribution!
I can see that adding the YAML to trigger generation of the IAM resources has resulted in acceptance tests for those IAM resources being generated only in the Beta version of the provider. This is because the first example in this file is used to generate the IAM tests, and that example is marked as beta-only. Could you please check if that test is able to be promoted to the GA provider too?
There's currently a problem in the generated acceptance tests e.g. :
iam_dataform_repository_generated_test.go:47:24 : fmt.Sprintf format %s reads arg #3, but call has 2 args
I believe the way to solve this is to add a primary_resource_name
property to the first example, similar to this example. The value of primary_resource_name
will be templated into the generate tests and provide the missing argument to fmt.Sprintf
Also, I'm not a Googler so I won't be able to view the internal ticket I'm afraid! If there's any information relevant to this PR that can't be shared publicly let me know and we can figure out next steps |
Thanks Sarah, for the review, honestly I am not sure if example should be added to GA since the resource is not published to GA itself ? as it min version is
Thanks for the example, I have added it. |
Nothing major as such, Its just some screenshots links which I had added in there, I can't attach them here, as the screenshot web page is internal to Google, so wont get opened from outside, but to summarise.
And through curl command was able to see the IAM policy getting added for a user. |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 2 files changed, 220 insertions(+)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_dataform_repository_iam_binding" "primary" {
condition {
description = # value needed
expression = # value needed
title = # value needed
}
}
Resource: resource "google_dataform_repository_iam_member" "primary" {
condition {
description = # value needed
expression = # value needed
title = # value needed
}
}
|
Ah I didn't spot that the resource is only managed by a beta API, in that case yes lets leave the example as beta only and we can ignore the Missing test report automation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following my last comment, please add min_version: beta
to the iam_policy
block - this will mean the IAM resources are only generated in the Beta provider, similar to the Repository resource and the generated IAM acceptance tests being beta-only.
For sure, Thank You |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 2 files changed, 220 insertions(+)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_dataform_repository_iam_binding" "primary" {
condition {
description = # value needed
expression = # value needed
title = # value needed
}
}
Resource: resource "google_dataform_repository_iam_member" "primary" {
condition {
description = # value needed
expression = # value needed
title = # value needed
}
}
|
Tests analyticsTotal tests: Action takenFound 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccDataformRepositoryIamBindingGenerated|TestAccDataformRepositoryIamPolicyGenerated|TestAccDataformRepositoryIamMemberGenerated |
|
Ok, there's a few problems happening with the acceptance tests.
This is due to an already existing problem with the first example in the Repository.yaml file. I've made a PR to fix this here #9462 that you could either pull into this PR or you could rebase your PR once it's merged to main.
Edit: I did some manual tests about importing and found that I was able to import IAM resources fine, so I'm not sure why the |
Sure, Thanks for looking into this and creating that PR, Ill also ping the guy for the PR you had raised, they may have some insights as well for this. |
That PR's just been merged into main, so if you rebase or pull main into your branch we can re-trigger the tests and see if anything related to the IAM resources requires fixing 🤞 |
a67c256
to
d15554e
Compare
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 2 files changed, 220 insertions(+)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_dataform_repository_iam_binding" "primary" {
condition {
description = # value needed
expression = # value needed
title = # value needed
}
}
Resource: resource "google_dataform_repository_iam_member" "primary" {
condition {
description = # value needed
expression = # value needed
title = # value needed
}
}
|
Tests analyticsTotal tests: Action takenFound 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccDataformRepositoryIamBindingGenerated|TestAccDataformRepositoryIamMemberGenerated|TestAccDataformRepositoryIamPolicyGenerated|TestAccSpannerDatabaseIamPolicy |
Rerun these tests in REPLAYING mode to catch issues
|
Hey @SarahFrench , Not sure if this is a transient issue or what possibly could be the reason for this, any idea what could be done now for this ? |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 2 files changed, 220 insertions(+)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_dataform_repository_iam_binding" "primary" {
condition {
description = # value needed
expression = # value needed
title = # value needed
}
}
Resource: resource "google_dataform_repository_iam_member" "primary" {
condition {
description = # value needed
expression = # value needed
title = # value needed
}
}
|
Tests analyticsTotal tests: Action takenFound 8 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccContainerAttachedCluster_containerAttachedClusterFullExample|TestAccContainerAttachedCluster_update|TestAccDataformRepositoryIamBindingGenerated|TestAccDataformRepositoryIamPolicyGenerated|TestAccDataformRepositoryIamMemberGenerated|TestAccDataprocClusterIamPolicy|TestAccDataprocJobIamPolicy|TestAccSpannerDatabaseIamPolicy |
Rerun these tests in REPLAYING mode to catch issues
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests pass! Merging now 🎉
…gleCloudPlatform#9457) * Adding IAM support in Terraform for Dataform Repository resource * Adding primary_resource_name property to Example * Adding min-version: beta to IAM policy of repository resource * Update import id used in acceptance tests --------- Co-authored-by: Sarah French <[email protected]>
…gleCloudPlatform#9457) * Adding IAM support in Terraform for Dataform Repository resource * Adding primary_resource_name property to Example * Adding min-version: beta to IAM policy of repository resource * Update import id used in acceptance tests --------- Co-authored-by: Sarah French <[email protected]>
…gleCloudPlatform#9457) * Adding IAM support in Terraform for Dataform Repository resource * Adding primary_resource_name property to Example * Adding min-version: beta to IAM policy of repository resource * Update import id used in acceptance tests --------- Co-authored-by: Sarah French <[email protected]>
…gleCloudPlatform#9457) * Adding IAM support in Terraform for Dataform Repository resource * Adding primary_resource_name property to Example * Adding min-version: beta to IAM policy of repository resource * Update import id used in acceptance tests --------- Co-authored-by: Sarah French <[email protected]>
Adding IAM support in Terraform for Dataform Repository resource
Internal tracking bug: b/309433506
Product Resource API Documentation: https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations.repositories
Did Manual Testing and it adds IAM policy to the repository added screenshots to the internal bug.
Release Note Template for Downstream PRs (will be copied)