Skip to content

docs: Protobuf schema docs shard from protoc source info (closes #9824) - #9953

Merged
TrapsterDK merged 1 commit into
mainfrom
protobuf-docs-shard
Nov 9, 2026
Merged

TrapsterDK merged 1 commit into
mainfrom
protobuf-docs-shard

Conversation

@TrapsterDK

Copy link
Copy Markdown
Collaborator

Closes #9824 (Protobuf). Avro schema docs are split out to #9936.

protobuf_doc_shard(proto, package) runs the protoc of the registered proto toolchain (optional @protobuf//bazel/private:proto_toolchain_type, so it resolves on every platform) with --include_source_info, then a new Rust extractor (tools/docs/protobuf/extract) turns the descriptor set into a DocIr shard. protoc-gen-doc was rejected: it is an unmaintained Go binary that only re-prints the comments protoc already keeps.

  • Message -> class, field -> field, enum -> enum, enum value -> variant, service -> interface, rpc -> method; member_of and dotted ids; map<K, V> fields shown as maps with entry messages hidden; streaming rpcs say stream.
  • Only the dependencies' descriptor sets are passed in (never the library's own), otherwise protoc drops the comments; a shard test fails on any empty doc.
  • docs aspect branch for proto_library, fixture with two protos (import, timestamp, service, enum, map), real aspect subject, languages.bzl doc tool, docs.md row, generation README paragraph, regenerated support matrix, crate registered and locks repinned with Bazel.

Tested: extractor unit tests, //tools/docs/protobuf:shard_test, //quality/testdata:real_docs_shards, support_matrix facts/generate tests. macro_rows_test fails with "BENCH is not a dict", which this change does not touch. Nested-Bazel and consumer tests were not run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hwESun1HL2eSVd1d5B

protobuf_doc_shard runs the protoc of the registered proto toolchain with
--include_source_info over a proto_library's own sources and converts the
descriptor set to a DocIr shard with a new Rust extractor. Messages map to
classes, fields to fields, enums and values to enums and variants, services
to interfaces and rpcs to methods; map fields show as maps and streaming
rpcs are marked. The docs aspect adds shards for proto_library targets.
Avro is split out to #9936.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xut2hwESun1HL2eSVd1d5B
@TrapsterDK
TrapsterDK merged commit cc8d1c5 into main Nov 9, 2026
1 check failed
@TrapsterDK
TrapsterDK deleted the protobuf-docs-shard branch November 9, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: schema docs for Protobuf with protoc-gen-doc and Avro

1 participant