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

[#16607] Fix: support iamMember (i.e. for WIF ids) in big query datasets #9948

Merged
merged 4 commits into from
Feb 15, 2024

Conversation

LucaPrete
Copy link
Member

@LucaPrete LucaPrete commented Feb 8, 2024

Fix: allow users to set permissions for principal/principalSets (iamMember) in BigQuery datasets.

Fixes github.com/hashicorp/terraform-provider-google/issues/16607

bigquery: allowed users to set permissions for `principal`/`principalSets` (`iamMember`) in `google_bigquery_dataset_iam_member`.

@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a: Community Contributor Googler Core Contributor. Tests will run automatically.

@ScottSuarez, 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 ( 2 files changed, 8 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 2 files changed, 8 insertions(+), 5 deletions(-))
TF Conversion: Diff ( 1 file changed, 3 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 107
Passed tests 99
Skipped tests: 8
Affected tests: 0

Click here to see the affected service packages
  • bigquery

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

@LucaPrete
Copy link
Member Author

Please wait to merge this. Adding tests and fixing a few things.

@LucaPrete LucaPrete requested a review from a team as a code owner February 9, 2024 08:08
@LucaPrete LucaPrete force-pushed the 16607_bigquery_ds_wif branch from 3520b86 to b556cb0 Compare February 9, 2024 08:11
@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, 77 insertions(+), 14 deletions(-))
Terraform Beta: Diff ( 4 files changed, 77 insertions(+), 14 deletions(-))
TF Conversion: Diff ( 1 file changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3424
Passed tests 3070
Skipped tests: 351
Affected tests: 3

Click here to see the affected service packages
all service packages are affected

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
TestAccBigqueryDatasetIamMember_iamMember|TestAccBigqueryDatasetIamMember_serviceAccount|TestAccWorkstationsWorkstationConfig_updateHostDetails

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccBigqueryDatasetIamMember_serviceAccount[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{Tests failed during RECORDING mode:}}$
TestAccBigqueryDatasetIamMember_iamMember[Error message] [Debug log]
TestAccWorkstationsWorkstationConfig_updateHostDetails[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

@LucaPrete
Copy link
Member Author

@rileykarson @ScottSuarez this is ready for review on my side but apparently the test here is failing.

I cannot reproduce the error on TestAccBigqueryDatasetIamMember_iamMember, while the other error seems completely unrelated with what I did.

Can you please help me to figure out what's going on?

Thank you!

case "user":
return "userByEmail", pieces[1], nil
case "serviceAccount":
return "userByEmail", pieces[1], nil
default:
return "", "", fmt.Errorf("Failed to parse BigQuery Dataset IAM member type: %s", member)
}
}
if member == "projectOwners" || member == "projectReaders" || member == "projectWriters" || member == "allAuthenticatedUsers" {
Copy link

Choose a reason for hiding this comment

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

Opportunistic refactoring/fix opportunity:
1- projectWriters, projectReaders, projectOwners are not documented as possible output https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/bigquery_dataset_iam#google_bigquery_dataset_iam_member

2- allUsers is documented but doesn't look to be a case handled by the API (?). https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#Dataset

Copy link

Choose a reason for hiding this comment

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

Feel free to ignore this comment if not relevant / I lack of context but I just ping you in case you missed this comment @LucaPrete .

Copy link
Member Author

Choose a reason for hiding this comment

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

Hey, sorry..I missed this. We can certainly work on this in a separate PR.

@LucaPrete LucaPrete requested a review from tgmof February 9, 2024 14:43
@ScottSuarez ScottSuarez requested review from tgmof, a team and c2thorn and removed request for ScottSuarez, tgmof and a team February 9, 2024 16:00
@c2thorn
Copy link
Member

c2thorn commented Feb 9, 2024

This may be due to an existing bug with google_bigquery_dataset_iam_member: hashicorp/terraform-provider-google#17172

I'll try running again to see if it is consistent

@c2thorn
Copy link
Member

c2thorn commented Feb 9, 2024

/gcbrun

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

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3424
Passed tests 3071
Skipped tests: 351
Affected tests: 2

Click here to see the affected service packages
all service packages are affected

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccBigqueryDatasetIamMember_iamMember|TestAccWorkstationsWorkstationConfig_updateHostDetails

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccBigqueryDatasetIamMember_iamMember[Error message] [Debug log]
TestAccWorkstationsWorkstationConfig_updateHostDetails[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

@melinath melinath removed the request for review from a team February 12, 2024 21:37
@LucaPrete
Copy link
Member Author

Hello @c2thorn do we know why this is still failing? We've a p1 open and we'd like to go through the review/merge as soon as we can. Please, let me know if there's anything I can do from my side.

@c2thorn
Copy link
Member

c2thorn commented Feb 13, 2024

@LucaPrete I do not know why it is failing, I believe it is an existing bug as seen in hashicorp/terraform-provider-google#17172

Nothing from the test config for your addition points to a bug that I can see, but I'm not going to be able to merge this yet until we solve it. I won't have time to do a deep debugging dive until late tomorrow.

I can run the test in a different environment to see if it environment-specific if you aren't able to recreate it.

@c2thorn
Copy link
Member

c2thorn commented Feb 13, 2024

Test failed again.

@LucaPrete do you have a debug log of a successful run?

@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, 78 insertions(+), 16 deletions(-))
Terraform Beta: Diff ( 4 files changed, 78 insertions(+), 16 deletions(-))
TF Conversion: Diff ( 1 file changed, 4 insertions(+), 5 deletions(-))

@LucaPrete
Copy link
Member Author

@c2thorn it should be all fixed now!

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3444
Passed tests: 3091
Skipped tests: 351
Affected tests: 2

Click here to see the affected service packages
all service packages are affected

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccBigqueryDatasetIamMember_iamMember|TestAccWorkstationsWorkstationConfig_updateHostDetails

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

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


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccWorkstationsWorkstationConfig_updateHostDetails[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

@c2thorn c2thorn merged commit cacc4c8 into GoogleCloudPlatform:main Feb 15, 2024
12 of 13 checks passed
tdbhacks pushed a commit to tdbhacks/magic-modules that referenced this pull request Feb 23, 2024
balanaguharsha pushed a commit to balanaguharsha/magic-modules that referenced this pull request Apr 19, 2024
balanaguharsha pushed a commit to balanaguharsha/magic-modules that referenced this pull request May 2, 2024
pengq-google pushed a commit to pengq-google/magic-modules that referenced this pull request May 21, 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.

BigQuery Dataset IAM Policy does not work for Federated Identity
4 participants