feat(sidekick/surfer): support surface-level cascading hiding via gcloud.yaml#5752
Merged
jameslynnwu merged 4 commits intogoogleapis:mainfrom May 7, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the handling of hidden commands by moving the "hidden" property from individual commands to the command group level. It updates the CommandGroup struct, the group builder logic, and the surface writer to apply the @base.Hidden decorator to generated Python classes. Additionally, it removes the redundant Hidden field from individual command definitions and updates the corresponding tests and test data. I have no feedback to provide.
278cbfb to
226efff
Compare
sarahheacock
reviewed
May 4, 2026
bc65dbd to
cf1452a
Compare
650316e to
7f393d5
Compare
ff4bfcd to
9b30275
Compare
sarahheacock
reviewed
May 7, 2026
sarahheacock
reviewed
May 7, 2026
…oud.yaml If a surface is configured as hidden in gcloud.yaml, we statically mark its root group, subgroups, and commands as hidden during tree construction. This is a simple surface-level cascading model to unblock basic command hiding. In the future, we plan to introduce fine-grained command-group and individual command-level hiding. This will require transitioning sidekick to a dynamic visibility model (such as a bottom-up AST traversal pass at the end of surface building) to resolve group visibility based on its children. - Propagates RootIsHidden from API config in gcloud.yaml to groups, subgroups, and commands during build. - Implements FindAPIConfigByService in config.go to support exact FQN service-level overrides matching. - Uses exact service-level scoping in group_builder.go and method-level scoping in command_builder.go to correctly resolve visibility for multi-API packages (e.g. keeping GA policy-bindings public under a shared root in iam). - Updates templates to conditionally output Calliope's @base.Hidden decorator for hidden groups and subgroups in python. Fixes googleapis#5510
…verification Renames the historical and misleading `hidden_command` mock test case to `hidden_surface` throughout the surfer codebase and expectations, clarifying that `root_is_hidden` explicitly tests surface-level CLI hiding. Additionally: - Renames hidden_command.proto to hidden_surface.proto and updates FQN service and package definitions. - Configures multi_service test overrides to hide SecondService while keeping FirstService public. - Regenerates surfer golden expected outputs to assert nested API subgroup hiding natively (GA policy-bindings under iam and firsts under multi_service remain public, while nested subgroups like seconds and resources are correctly flagged hidden).
fb19761 to
bbbface
Compare
sarahheacock
reviewed
May 7, 2026
sarahheacock
reviewed
May 7, 2026
sarahheacock
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a surface is configured as hidden in gcloud.yaml, we statically mark its root group, subgroups, and commands as hidden during tree construction.
This is a simple surface-level cascading model to unblock basic command hiding. In the future, we plan to introduce fine-grained command-group and individual command-level hiding. This will require transitioning sidekick to a dynamic visibility model (such as a bottom-up AST traversal pass at the end of surface building) to resolve group visibility based on its children.
Fixes #5510