Skip to content

docs(proto): enrich API documentation for all service protos#19659

Open
sthadka wants to merge 5 commits intomasterfrom
feat/proto-enrichment
Open

docs(proto): enrich API documentation for all service protos#19659
sthadka wants to merge 5 commits intomasterfrom
feat/proto-enrichment

Conversation

@sthadka
Copy link
Copy Markdown
Contributor

@sthadka sthadka commented Mar 27, 2026

Description

Adds comprehensive documentation comments to all 59+ API service proto files
and introduces a CI check to prevent undocumented RPCs from being merged.

Proto comments flow through code generation into Swagger specs, gRPC stubs,
and downstream OpenAPI docs, enabling Stripe-quality API documentation
renderers (Redocly, Scalar) without maintaining separate doc sources.

What changed:

  • Documented every RPC method, message, field, and enum across all proto/api/v1/
    and proto/api/v2/ service protos with descriptions covering purpose, behavior,
    required fields, side effects, and permission requirements
  • Regenerated all downstream artifacts (.swagger.json, .pb.go, _grpc.pb.go)
  • Updated bundled RHEL swagger specs (image/rhel/docs/api/)
  • Added check-rpc-docs.sh CI gate that fails make style if any RPC lacks a
    doc comment
  • Added enrichment workflow script (scripts/enrich-proto/) for future proto
    documentation maintenance

Why proto comments instead of separate docs:

  • Single source of truth — comments live next to the code they describe
  • Zero drift — make proto-generated-srcs propagates changes automatically
  • IDE support — gRPC docs appear in hover/autocomplete in any language

Alternative considered: Enriching storage protos as well (as attempted in
PR #15999). Decided against it because storage types are internal implementation
details that should not leak into the public API surface.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

CI check check-rpc-docs.sh validates that no undocumented RPCs exist.
No runtime behavior changes — documentation comments only.

How I validated my change

  • Ran make proto-generated-srcs to regenerate all downstream artifacts
  • Verified bash tools/check-service-protos/check-rpc-docs.sh passes (exit 0)
  • Verified bash tools/check-service-protos/run.sh passes (exit 0)
  • Spot-checked swagger output to confirm proto comments propagate correctly
  • Rendered swagger specs locally with Swagger UI to verify documentation appears

Partially generated by AI.

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Mar 27, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@sthadka sthadka force-pushed the feat/proto-enrichment branch 4 times, most recently from 3c4886b to d0cf5c6 Compare March 28, 2026 08:55
Added human-readable descriptions to RPC methods, request/response
fields, and enum values across all 59 gRPC service definitions
(48 v1 + 11 v2). Descriptions cover:

- What each RPC does and when to use it
- Field semantics, formats, and constraints
- Enum value meanings
- Pagination, filtering, and query parameter usage

This brings API description coverage from ~15% to 98% of operations,
enabling downstream tooling (OpenAPI spec generation, SDK codegen,
API documentation sites) to produce useful output without manual
annotation.

No behavioral changes — proto comments only affect generated
documentation artifacts (swagger/OpenAPI).

Partially generated by AI.
@sthadka sthadka force-pushed the feat/proto-enrichment branch from d0cf5c6 to 2af9b8c Compare March 28, 2026 09:21
@rhacs-bot
Copy link
Copy Markdown
Contributor

rhacs-bot commented Mar 28, 2026

Images are ready for the commit at 0af87e2.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-478-g0af87e2553.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.38%. Comparing base (0737966) to head (0af87e2).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19659   +/-   ##
=======================================
  Coverage   49.37%   49.38%           
=======================================
  Files        2743     2743           
  Lines      207037   207037           
=======================================
+ Hits       102223   102243   +20     
+ Misses      97228    97213   -15     
+ Partials     7586     7581    -5     
Flag Coverage Δ
go-unit-tests 49.38% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

sthadka added 4 commits March 28, 2026 15:06
Regenerated all 57 Swagger JSON files from the enriched proto
definitions. Changes are documentation-only — descriptions now
appear in the generated Swagger spec for all enriched RPCs,
fields, and enums.

Generated output from: make proto-generated-srcs

Partially generated by AI.
Updated the v1 and v2 Swagger JSON files bundled in the RHEL container
image with enriched API descriptions.

Partially generated by AI.
Adds scripts/enrich-proto/ with:
- run.sh: automated proto enrichment runner
- WORKFLOW.md: documents the enrichment process, audit checklist,
  and regeneration steps

These scripts were used to enrich all 59 service proto files and
can be reused for future enrichment passes when new services or
fields are added.

Partially generated by AI.
Add check-rpc-docs.sh to the existing check-service-protos CI gate.
The script scans all proto/api/ service protos and fails if any RPC
method lacks a documentation comment above it.

Also documents 5 RPCs in report_service.proto and
virtual_machine_service.proto that were missing comments.

Partially generated by AI.
@sthadka sthadka force-pushed the feat/proto-enrichment branch from 2af9b8c to 0af87e2 Compare March 28, 2026 14:07
@sthadka sthadka marked this pull request as ready for review March 28, 2026 19:58
@sthadka
Copy link
Copy Markdown
Contributor Author

sthadka commented Mar 28, 2026

/test all

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Mar 28, 2026

@sthadka: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/gke-scanner-v4-install-tests 0af87e2 link false /test gke-scanner-v4-install-tests
ci/prow/gke-operator-e2e-tests 0af87e2 link false /test gke-operator-e2e-tests
ci/prow/ocp-4-12-scanner-v4-install-tests 0af87e2 link false /test ocp-4-12-scanner-v4-install-tests
ci/prow/ocp-4-12-operator-e2e-tests 0af87e2 link false /test ocp-4-12-operator-e2e-tests

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants