feat(crd-docs): mark beta CRDs with (beta) heading suffix and badge - #1833
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 |
Feediver1
left a comment
There was a problem hiding this comment.
PR Review (docs-team-standards final pass)
Files reviewed: 2 (the crd-ref-docs type.tpl template + local playbook badge-macro registration)
Overall assessment: Excellent, unusually well-verified tooling PR — the design rationale, anchor-stability proof, and pattern validation are in the body and check out independently. One small pattern gap, and one delivery-coordination item that matters because GA is today.
Critical issues
None in the change itself. One delivery-coordination item: this PR marks nothing by itself — the badges appear only on the next regen, and the regen in flight (#1830) was generated before this template change, so its output is unmarked. Sequence needed: merge this + #1830, then rerun the CRD regen (generate-crd.yml) so the marked output reaches beta before promotion. Worth stating the plan in the PR body so it doesn't fall between the two PRs.
Suggestion
NamedValueSourceescapes the pattern. It's a Pipeline-family, beta-only type (introduced with the Pipeline CRD in #1830, referenced byPipelineSpec.valueSources, with its own generated section) — but it starts with "N", so it renders unmarked while its six sibling sections get badges. Extend the pattern (for example^(Pipeline|Stretch|Shadow|NamedValueSource$)) or document the exclusion in the template comment. (ValueSourceis correctly unmatched — it pre-dates Pipeline onbetaas a shared type.)
Verified (independently, not just from the body)
- Badge macro is registered in the production docs-site playbook — the local-playbook addition achieves preview/production parity.
- Pattern behavior spot-checked: matches Pipeline/PipelineSpec/StretchListeners/ShadowTopicState, correctly skips shared
ValueSource— consistent with the body's 221-section no-false-positive claim. - The anchor-stability argument is structurally sound (explicit
[id="..."]lines mean heading text can't affect IDs), and the byte-identical diff proof is the right evidence.
What works well
- Template-level design is the correct call, and the body's why-not-config/post-processing explanation (config paths don't converge; crd-ref-docs can't pass custom values to templates) is the kind of decision record that saves the next maintainer an afternoon.
- Prefix-matching with documented counts (6/17/21) instead of exact kind names shows the failure mode was thought through.
- Validation against the real pinned binary and two real operator sources — this is what "verified" should mean.
Minor: no DOC ticket linked; a DOC-2275/DOC-2198 reference in the body would help traceability.
🤖 Generated with Claude Code
NamedValueSource is a Pipeline-family, beta-only supporting type but does not share the Pipeline prefix, so it rendered unmarked while its six sibling sections got badges. Match it exactly; the shared ValueSource type predates Pipeline and stays GA/unmarked. Beta section count goes from 44 to 45. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Applied the review's suggestion in Reminder on the delivery sequencing from the review: after this and #1830 both merge, rerun 🤖 Generated with Claude Code |
The gap
The auto-generated
modules/reference/pages/k-crd.adoccarries no beta indicators for beta CRDs. The Pipeline CRD is a beta feature in operator 26.2 (per the 26.2 release notes, which mark only Redpanda Connect pipelines and Gateway API Console support as beta), but its sections render unmarked in the otherwise-GA reference page. StretchCluster and ShadowLink are GA in 26.2. The NodePool CRD (beta since 26.1) is not part of this reference page, and its own page already carries:page-beta: true.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 a prefix rather than exact kind names because a beta CRD brings a family of generated type sections that are all beta:
Pipeline*(6 sections: Pipeline, PipelineBudget, PipelinePhase, PipelineSpec, PipelineStatus, PipelineUserRef) plusNamedValueSource(exact match, a Pipeline-only supporting type that does not share the prefix; the sharedValueSourcetype predates Pipeline and stays GA). 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 beta sections (7 with the final Pipeline-only pattern). 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|NamedValueSource$)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.History note: an earlier revision of this PR also marked
Stretch*andShadow*types. That was wrong. Stretch Clusters and ShadowLink are GA in 26.2, and the pattern was corrected to Pipeline-only in commit 51a025f. The anchor-stability proof is pattern-independent (anchors come from explicit[id=...]lines, not heading text).🤖 Generated with Claude Code