fix(internal/surfer): identify singletons and preserve command leaf nodes#5018
fix(internal/surfer): identify singletons and preserve command leaf nodes#5018sarahheacock merged 5 commits intomainfrom
Conversation
… leaf nodes * Identify singleton resources using a variable name heuristic and omit them from the command group hierarchy (not supported in declarative framework). * Ensure that flattened segments (such as locations or zones) are not skipped over when they contain commands. Fixes #4980
|
Best to review by commit.
|
There was a problem hiding this comment.
Code Review
This pull request enhances the gcloud provider's resource and service name resolution logic. Key changes include the introduction of IsSingletonFromSegments to identify singleton resources and ResolveRootPackage to extract service names from package paths. The PR also refactors path parsing in tests and updates golden files to reflect improved naming conventions for generated Python classes. Review feedback identified a bug in the singleton detection logic regarding version prefixes and a documentation typo in the new service info helper.
…ther than the method binding
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces logic to handle singleton resources and improves the resolution of root package names for command groups. Key changes include adding a heuristic to identify singleton resources based on path patterns, updating the command tree builder to prevent skipping flattened segments when they are leaf nodes, and refactoring path parsing in tests to use realistic resource patterns. Additionally, the golden file test utility was simplified, and several autogenerated test files were updated to reflect improved naming conventions. I have no feedback to provide.
ianthehat
left a comment
There was a problem hiding this comment.
Looks fine.
I think we should probably add most of this functionality to the api package in the long run.
💯 |
Fixes #4980