Skip to content

WIP: Simplify godocs on APIs#4888

Draft
rikatz wants to merge 1 commit into
kubernetes-sigs:mainfrom
rikatz:godoc-simplify
Draft

WIP: Simplify godocs on APIs#4888
rikatz wants to merge 1 commit into
kubernetes-sigs:mainfrom
rikatz:godoc-simplify

Conversation

@rikatz
Copy link
Copy Markdown
Member

@rikatz rikatz commented May 20, 2026

What type of PR is this?
/kind cleanup
/kind documentation

What this PR does / why we need it:

This PR simplifies the exposed Godocs, moving user facing comments and implementers guides to proper places to reduce the burden of a user when reading the API docs, while making the docs still useful.

This is a WIP, written by claude based on the Documentation design and I wanted to see how far the changes would go. This is still to be (heavily) discussed

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

Simplify the user exposed API documentations

Claude Summary

Reorganize Gateway API godoc comments to separate user-facing documentation
from implementation details using <gateway:util:excludeFromCRD> tags.

User-facing text (what a field does, valid values, support level) stays visible
in CRDs, kubectl explain, and API references. Implementation details
(conditions to set, error handling, precedence rules, reconciliation behavior)
move behind the tags — still visible in Go source and go doc, but stripped
from generated CRDs.

Changes

30 changes across 5 files in apis/v1/:

  • gateway_types.go — 11 fields: Listeners, Hostname, AllowedRoutes,
    ProtocolType, ClientCertificateRef, CertificateRefs, CACertificateRefs,
    Value, Addresses, SupportedKinds, AttachedRoutes
  • httproute_types.go — 8 fields: Hostnames, Matches, Filters, BackendRefs,
    Type, BackendRef (mirror), BackendRef (backend), ExternalAuthProtocol
  • grpcroute_types.go — 6 fields: Hostnames, Matches, Filters, BackendRefs,
    Type, BackendRef
  • backendtlspolicy_types.go — 2 fields: TargetRefs, CACertificateRefs
  • shared_types.go — 3 fields: SectionName, Port, ParentRefs

Not changed (struct-level comments): GatewayClass and GRPCRoute type
descriptions were left as-is because the CRD generator only processes
excludeFromCRD tags on field descriptions, not on type-level descriptions.

CRD Size Reduction

CRD Before After Saved %
backendtlspolicies 78,552 67,944 10,608 13.5%
gatewayclasses 23,259 23,259 0 0%
gateways 188,718 146,274 42,444 22.5%
grpcroutes 122,706 111,242 11,464 9.3%
httproutes 429,092 402,156 26,936 6.3%
listenersets 42,618 42,162 456 1.1%
referencegrants 14,852 14,852 0 0%
tlsroutes 120,610 108,727 11,883 9.8%
Total 1,020,407 916,616 103,791 10.2%

Constraints

  • No semantic changes — documentation content is only reorganized
  • Blank lines and formatting preserved
  • No kubebuilder marker changes
  • All text remains in Go source (visible via go doc)

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

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

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/documentation Categorizes issue or PR as related to documentation. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 20, 2026
@k8s-ci-robot k8s-ci-robot requested review from aojea and thockin May 20, 2026 23:28
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 20, 2026
@rikatz
Copy link
Copy Markdown
Member Author

rikatz commented May 20, 2026

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 20, 2026
@rikatz
Copy link
Copy Markdown
Member Author

rikatz commented May 21, 2026

/approve cancel

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign thockin for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/documentation Categorizes issue or PR as related to documentation. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants