fix: restore messages not attached to rpc in selective_gapic_generation#16951
fix: restore messages not attached to rpc in selective_gapic_generation#16951parthea wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the selective GAPIC generation logic by replacing the multi-step allowlist and pruning process with a unified with_selective_generation method across the Proto, Service, and Method classes. This consolidation simplifies the code by handling both internal method marking and service/method omission in a single pass. The review feedback highlights the need for docstrings on the new methods and recommends updating return type hints to Optional to correctly handle cases where objects are filtered out (returning None). Specifically, the Proto implementation should be updated to return None if it becomes empty after filtering.
5d8ec63 to
22ddb97
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the selective GAPIC generation logic by consolidating several methods into a unified with_selective_generation implementation across the Proto, Service, and Method classes. The updated logic refines how messages are pruned, ensuring that only top-level request/response messages of omitted RPCs are excluded while keeping other reachable types. Review feedback highlights missing docstrings and incorrect return type hints for the new methods, which should be updated to Optional where None can be returned. Additionally, there is a concern regarding potential non-determinism in the global service mapping used for cross-proto lookups.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the selective GAPIC generation logic to more precisely control which components are excluded. It replaces several pruning methods with a unified with_selective_generation approach that targets only the top-level request and response messages of omitted RPCs for exclusion, while preserving other reachable messages. Additionally, the Address class hash function was updated to exclude api_naming to maintain the hash contract. Review feedback highlighted a potential collision risk in the global service map used for extended LROs, suggesting the use of fully qualified names instead of short names to ensure correct resolution.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the selective GAPIC generation logic by consolidating pruning and internal-marking functionality into a unified with_selective_generation method across the schema classes. The changes improve the precision of message exclusion, ensuring that only top-level request/response messages of omitted RPCs are removed while keeping reachable dependencies. Additionally, the Address class's hash function was updated to support its use as a dictionary key. A critical bug was identified in the global service lookup map where a type mismatch between string keys and Address object lookups would result in a KeyError during extended LRO processing.
552034c to
5dbd520
Compare
5dbd520 to
a532424
Compare
ba521c2 to
7915ee3
Compare
Towards b/507893758, b/507889482, b/501132869, b/503326310