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(policytroubleshooter): v3 PolicyTroubleshooter service added #12403

Merged
merged 6 commits into from
Aug 30, 2023

Conversation

scotthart
Copy link
Member

@scotthart scotthart commented Aug 17, 2023

This change is Reviewable

@scotthart scotthart requested a review from a team as a code owner August 17, 2023 16:49
@scotthart scotthart temporarily deployed to internal August 17, 2023 16:49 — with GitHub Actions Inactive
@product-auto-label product-auto-label bot added the api: policytroubleshooter Issues related to the IAM Policy Troubleshooter API API. label Aug 17, 2023
@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01% ⚠️

Comparison is base (80e0a05) 93.62% compared to head (f19f6c4) 93.62%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12403      +/-   ##
==========================================
- Coverage   93.62%   93.62%   -0.01%     
==========================================
  Files        2043     2043              
  Lines      180841   180841              
==========================================
- Hits       169315   169314       -1     
- Misses      11526    11527       +1     

see 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@scotthart scotthart temporarily deployed to internal August 17, 2023 17:59 — with GitHub Actions Inactive
@@ -230,6 +230,8 @@ set(external_googleapis_installed_libraries_list
google_cloud_cpp_iam_v1_iam_policy_protos
google_cloud_cpp_iam_v1_options_protos
google_cloud_cpp_iam_v1_policy_protos
google_cloud_cpp_iam_v2_deny_protos
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 google/cloud/iam is already compiling these protos. I believe this change introduces a second library that compiles the same protos. That is basically an ODR violation waiting to happen.

If I am right, we need to refactor these common protos to a new library or we need to have google/cloud/policytroubleshooter depend on google/cloud/iam. The first option seems more desirable, and it would be similar to the pure-protos library in google/cloud/grafeas.

Copy link
Member

Choose a reason for hiding this comment

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

This change makes it so that we always build the v2 protos.

I think we can clean it up as part of #8022.

Copy link
Member Author

@scotthart scotthart left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 70 files reviewed, 1 unresolved discussion (waiting on @coryan)


external/googleapis/CMakeLists.txt line 233 at r1 (raw file):

Previously, coryan (Carlos O'Ryan) wrote…

I think google/cloud/iam is already compiling these protos. I believe this change introduces a second library that compiles the same protos. That is basically an ODR violation waiting to happen.

If I am right, we need to refactor these common protos to a new library or we need to have google/cloud/policytroubleshooter depend on google/cloud/iam. The first option seems more desirable, and it would be similar to the pure-protos library in google/cloud/grafeas.

So I can put them in a new common lib google_cloud_cpp_iam_v2_policy_protos and make iam depend on that new lib, but external/googleapis/update_libraries.sh adds both

@com_google_googleapis//google/iam/v2:deny.proto
@com_google_googleapis//google/iam/v2:policy.proto

to the iam.list file which returns us to having the protos compiled in two places.

Thoughts?

@coryan
Copy link
Contributor

coryan commented Aug 18, 2023

external/googleapis/CMakeLists.txt line 233 at r1 (raw file):

Previously, scotthart (Scott Hart) wrote…

So I can put them in a new common lib google_cloud_cpp_iam_v2_policy_protos and make iam depend on that new lib, but external/googleapis/update_libraries.sh adds both

@com_google_googleapis//google/iam/v2:deny.proto
@com_google_googleapis//google/iam/v2:policy.proto

to the iam.list file which returns us to having the protos compiled in two places.

Thoughts?

I think you would need to remove this line in update_libraries.sh :

"@com_google_googleapis//google/iam/v2:iam_cc_grpc"

You would also need to change the iam CMake file to link your new common library.

And you would need to change the CMake files to treat this common library as a dependency of iam.

@coryan
Copy link
Contributor

coryan commented Aug 18, 2023

external/googleapis/CMakeLists.txt line 233 at r1 (raw file):

Previously, coryan (Carlos O'Ryan) wrote…

I think you would need to remove this line in update_libraries.sh :

"@com_google_googleapis//google/iam/v2:iam_cc_grpc"

You would also need to change the iam CMake file to link your new common library.

And you would need to change the CMake files to treat this common library as a dependency of iam.

FWIW, I think it would be easier (and cleaner) if you made these changes in a PR preparing for this new library.

@scotthart scotthart temporarily deployed to internal August 18, 2023 19:09 — with GitHub Actions Inactive
"language": "cpp",
"library_type": "GAPIC_AUTO",
"name_pretty": "Policy Troubleshooter API",
"product_documentation": "https://cloud.google.com/policy-intelligence/docs/troubleshoot-access",
Copy link
Member

@dbolduc dbolduc Aug 18, 2023

Choose a reason for hiding this comment

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

This link seems to indicate that the feature is "pre-GA" 🙄

do we need to add an experimental: true field to the generator config? or not generate it at all...

Copy link
Member Author

Choose a reason for hiding this comment

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

It went GA this week. There may be a rollout delay on the documentation.

@scotthart scotthart temporarily deployed to internal August 29, 2023 14:57 — with GitHub Actions Inactive
@scotthart scotthart temporarily deployed to internal August 29, 2023 16:41 — with GitHub Actions Inactive
@scotthart scotthart temporarily deployed to internal August 29, 2023 16:55 — with GitHub Actions Inactive
Copy link
Member

@dbolduc dbolduc left a comment

Choose a reason for hiding this comment

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

Sorry, looks like #12487 won the race

@@ -14,6 +14,7 @@

include(CMakeFindDependencyMacro)
# google_cloud_cpp_googleapis finds both gRPC and Protobuf, no need to load them here.
find_dependency(google_cloud_cpp_iam_policy)
Copy link
Member

Choose a reason for hiding this comment

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

I just deleted this file out from under you...

Comment on lines 21 to 25
set(GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES
"${PROJECT_BINARY_DIR}/google/cloud/iam_policy")

google_cloud_cpp_add_ga_grpc_library(policytroubleshooter
"Policy Troubleshooter API")
Copy link
Member

Choose a reason for hiding this comment

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

This should handle the config.cmake.in and the DOXYGEN_EXTRA_INCLUDES:

google_cloud_cpp_add_ga_grpc_library(policytroubleshooter
                                     "Policy Troubleshooter API"
                                     CROSS_LIB_DEPS "iam_policy")

@scotthart scotthart temporarily deployed to internal August 29, 2023 17:18 — with GitHub Actions Inactive
Copy link
Member Author

@scotthart scotthart left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 75 files reviewed, 4 unresolved discussions (waiting on @coryan and @dbolduc)

a discussion (no related file):

Previously, dbolduc (Darren Bolduc) wrote…

(Reviewable was unable to map this GitHub inline comment thread to the right spot — sorry!)

I just deleted this file out from under you...

Rebased.



external/googleapis/CMakeLists.txt line 233 at r1 (raw file):

Previously, coryan (Carlos O'Ryan) wrote…

FWIW, I think it would be easier (and cleaner) if you made these changes in a PR preparing for this new library.

Done.


google/cloud/policytroubleshooter/CMakeLists.txt line 25 at r3 (raw file):

Previously, dbolduc (Darren Bolduc) wrote…

This should handle the config.cmake.in and the DOXYGEN_EXTRA_INCLUDES:

google_cloud_cpp_add_ga_grpc_library(policytroubleshooter
                                     "Policy Troubleshooter API"
                                     CROSS_LIB_DEPS "iam_policy")

Done.

@scotthart scotthart temporarily deployed to internal August 29, 2023 17:26 — with GitHub Actions Inactive
Comment on lines +21 to +22
set(GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES
"${PROJECT_BINARY_DIR}/google/cloud/iam_policy")
Copy link
Member

Choose a reason for hiding this comment

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

can remove this. It is handled by CROSS_LIB_DEPS

@@ -1,23 +0,0 @@
# Copyright 2023 Google LLC
Copy link
Member

Choose a reason for hiding this comment

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

uh oh...

@scotthart scotthart temporarily deployed to internal August 29, 2023 17:32 — with GitHub Actions Inactive
@@ -14,6 +14,7 @@

include(CMakeFindDependencyMacro)
# google_cloud_cpp_googleapis finds both gRPC and Protobuf, no need to load them here.
find_dependency(google_cloud_cpp_iam_policy)
Copy link
Member

Choose a reason for hiding this comment

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

gah!

Copy link
Member

Choose a reason for hiding this comment

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

remove this.

Copy link
Member Author

@scotthart scotthart left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 75 files reviewed, 6 unresolved discussions (waiting on @coryan and @dbolduc)


cmake/templates/config.cmake.in line 0 at r5 (raw file):

Previously, dbolduc (Darren Bolduc) wrote…

(Reviewable was unable to map this GitHub inline comment thread to the right spot — sorry!)

uh oh...

hopefully correctly reverted this merge consequence

@scotthart scotthart temporarily deployed to internal August 29, 2023 17:50 — with GitHub Actions Inactive
Copy link
Contributor

@coryan coryan left a comment

Choose a reason for hiding this comment

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

Reviewed 63 of 70 files at r1, 9 of 11 files at r3, 1 of 3 files at r4, 1 of 1 files at r7, 1 of 1 files at r8, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @dbolduc and @scotthart)

@scotthart scotthart merged commit 7212399 into googleapis:main Aug 30, 2023
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: policytroubleshooter Issues related to the IAM Policy Troubleshooter API API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants