mirror of
https://github.com/gravitational/teleport.git
synced 2026-09-19 01:58:44 +08:00
The resource ref generator was not properly handling API_HYBRID protobuf files. When protoc generates code for API_HYBRID protos (configured in buf-go.gen.yaml), it creates two versions: 1. Regular .pb.go files with exported struct fields (build tag: !protoopaque) 2. _protoopaque.pb.go files with xxx_hidden_* fields (build tag: protoopaque) The generator was randomly picking up whichever file it encountered first. When it selected the protoopaque variant, all struct fields were unexported (starting with xxx_hidden_), causing them to be filtered out during documentation generation, resulting in empty or incomplete reference pages. This change adds a filter to skip _protoopaque.pb.go files during the source code walk, ensuring the generator only processes regular .pb.go files that contain properly exported fields with full documentation. This fix enables proper documentation generation for all API_HYBRID resources, including bot_instance and other protobuf-based resources. This is a temporary change, we must convert resource geneneration to use proto as source instead of go structs otherwise we will never be able to migrate to proto opaque api. Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>