feat(crd-docs): mark beta CRDs with (beta) heading suffix and badge - #1833
feat(crd-docs): mark beta CRDs with (beta) heading suffix and badge#1833JakeSCahill wants to merge 1 commit into
Conversation
The generated CRD reference (k-crd.adoc) carried no beta indicators for beta CRDs. Pipeline, StretchCluster, and ShadowLink are beta features in operator 26.2 but rendered unmarked in the otherwise-GA reference page. Add a beta-type pattern to the crd-ref-docs type template. Types whose names match the pattern get a plain (beta) suffix on the section heading and a badge::[label=beta] line at the start of the section body. The explicit [id=...] anchor above each heading is untouched, so all existing xrefs and inbound links keep resolving to the same anchors. The pattern lives in one commented line at the top of type.tpl. Writers edit that line when a feature graduates to GA or a new beta CRD ships. Because every regeneration path (the generate-crd.yml workflow, the doc-tools generate crd-spec command, and manual crd-ref-docs runs) consumes these templates, the marking survives any regen without touching the operator repo. Also register the badge macro in the local Antora playbook so local previews render the badge the same way the production site does.
✅ Deploy Preview for redpanda-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The gap
The auto-generated
modules/reference/pages/k-crd.adoccarries no beta indicators for beta CRDs. Pipeline, StretchCluster, and ShadowLink are beta features in operator 26.2, but their sections render unmarked in the otherwise-GA reference page.The convention
Per the team convention for beta features inside an otherwise-GA page:
(beta)suffix on the section heading (no macros in headings, which leak markup into the TOC and anchors).badge::[label=beta]badge at the start of the section body.:page-beta:is not used because the page as a whole is GA.Design choice: template-level marking, driven by one editable pattern
The marking is implemented in the docs-side crd-ref-docs template (
.github/crd-config/templates/asciidoctor/operator/type.tpl), keyed on a single commented pattern at the top of the template:Why the template rather than a post-processing step or a
betaKindsentry in.github/crd-config/config.yaml:generate-crd.ymlworkflow, the doc-toolsgenerate crd-speccommand (its default--templates-diris this directory), and manualcrd-ref-docsruns all consume.github/crd-config/templates/asciidoctor/operator. A post-processing step would have to be wired into each of those paths separately and would silently drop off any path that forgets it. The config paths do NOT converge the same way: the workflow and doc-tools both pull the crd-ref-docs config from the operator repo, so.github/crd-config/config.yamlhere is not consumed by any regen path today, and abetaKindslist there would be dead config.regexMatchis available (verified by running the real binary).The pattern uses prefixes rather than exact kind names because each beta CRD brings a family of generated type sections that are all beta:
Pipeline*(6 sections),Stretch*(17 sections, includingStretchListeners,StretchStorage, and other StretchCluster config types that do not start withStretchCluster), andShadow*(21 sections, includingShadowTopicState/ShadowTopicStatuswhich do not start withShadowLink). Verified against the full 221-section output that no GA type matches the pattern.This PR also registers
@redpanda-data/docs-extensions-and-macros/macros/badgeinlocal-antora-playbook.ymlso local previews render the badge. The production docs-site playbooks already register it.Anchor stability
The templates emit an explicit
[id="..."]anchor line above every heading, so the heading text does not participate in ID generation:Proof from a real render (not just the source): generated the page before and after the change, converted both with Asciidoctor (with the real
badgemacro from docs-extensions-and-macros registered), and diffed the 221<h2 id="...">values. Byte-identical. Heading text differs only by the(beta)suffix on the 44 beta sections. Existing xrefs such asxref:reference:k-crd.adoc#k8s-api-github-com-redpanda-data-redpanda-operator-operator-api-redpanda-v1alpha2-pipelinekeep resolving unchanged.Validation
Ran the real generation locally with
crd-ref-docsv0.1.0 (same version and flags asgenerate-crd.yml), against two operator sources, using the same GA ignore config as the #1817/#1830 regens:operator/v26.2.1-beta.3tag (204 sections, StretchCluster + ShadowLink, no Pipeline because that tag predates the Pipeline CRD merge)main(221 sections, includes Pipeline, same source Regenerate CRD reference with the Pipeline CRD #1830 regenerated from)Old templates vs new templates, on the operator-main output:
[id=...]anchor lines in the .adoc<h2 id>values in rendered HTML(beta)heading suffix^(Pipeline|Stretch|Shadow)badge::[label=beta]lines added<span class="badge badge--beta">in the renderExample rendered output for the Pipeline section:
What this PR does not do
k-crd.adocitself is not regenerated here. #1830 (open, also based onbeta) already regenerates it from operator main to add the Pipeline CRD. Regenerating in this PR too would duplicate and conflict with that work. After this merges, rerunning the #1830 regen with these templates (a singlecrd-ref-docscommand) picks up the beta markers, and every future regen keeps them.If the same marking is wanted on
main(its 26.1 reference contains ShadowLink sections), the template change can be cherry-picked there with the pattern adjusted to the 26.1 beta set.🤖 Generated with Claude Code