-
Notifications
You must be signed in to change notification settings - Fork 50
fix: revert dict back to protobuf in the iam binding update #1838
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
Conversation
This is needed as some recent updates to a dependency (google-cloud-resource-manager or its dependencies) broke the existing logic, and we are seeing the error like this: --> policy.bindings.append(new_binding) TypeError: Expected a message object, but got {'role': 'roles/run.invoker', 'members': [...]}
Let's try to update google3 first. That google.iam namespace is indeed problematic |
CC @parthea Did the gapic generator make a breaking change to no longer allow dictionary inputs? |
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.
I'm a bit concerned that this indicates a breaking change happened in the resource manager client library. Please find the change that broke dictionaries. We might need to update our dependencies in setup.py
and the constraints files if this breaking change was intended.
bigframes/clients.py
Outdated
} # Use a dictionary to avoid problematic google.iam namespace package. | ||
new_binding = google.iam.v1.policy_pb2.Binding( | ||
role=role, members=[service_account] | ||
) # Use a dictionary to avoid problematic google.iam namespace package. |
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.
This comment is now out-of-date.
) # Use a dictionary to avoid problematic google.iam namespace package. | |
) |
Could you try this in google3? I wonder if a //google/iam/v1:iam_policy_py_pb2
dependency was missing last time I tried it?
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.
Trying.. but that one should be indirectly included via resourcemanager_v3 (which does include it)?
I tested that even with google-cloud-resource-manager==1.12.0 (more than an year old) the dictionary update does not work. So the break happened with the proto->dictionary change. It is a case of missing test coverage for the IAM update code path (which is not integration tested due to internal test project policies where IAM permissions are managed via config). I am adding a mocked unit test which covers at least the binding update part. |
This is needed as some recent updates to a dependency (google-cloud-resource-manager or its dependencies) broke the existing logic, and we are seeing the error like this:
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes internal issues 419589974, 425442503 🦕