DOCS-2970: Fail the build when a FelixConfig lookup key doesn't resolve#2820
Conversation
…ne fields The felixconfig.mdx pages render field groups via the FelixConfig component, which matches a group by exact string: `jsonData.Groups.find((group) => group.Name === name)`. The group names come from config-params.json, which is auto-synced from the Felix source repos and must not be hand-edited. A prose/casing style sweep (573e3bb) rewrote the functional `name=` lookup keys as if they were prose (`Dataplane:` -> `Data plane:`, `...iptables dataplane` -> `...iptables data plane`, `Wireguard` -> `WireGuard`), so 8 groups -- including "Dataplane: iptables" and with it `iptablesRefreshInterval` -- no longer matched any generated group name and rendered "No matching group found", dropping their fields. Correct the `name=` lookup keys in the affected calico and calico-enterprise felixconfig.mdx files (current + versioned_docs) to exactly match each file's own config-params.json. Visible `####` headings are left as the restyled prose; only the lookup keys change. version-3.29's JSON already uses `Data plane:`, so only the WireGuard fix applies there. calico-cloud was untouched by the sweep. Surfaced during the Visa RCA (CI-2011). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for calico-docs-preview-next ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview succeeded!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR hardens the FelixConfig MDX component used across Calico OSS / Enterprise / Cloud docs so that an unresolved group-name lookup fails the Docusaurus build (instead of silently rendering an easy-to-miss “No matching group found” message). It also updates several name= lookup keys in felixconfig.mdx pages to match the exact group Name values in each version’s sibling config-params.json.
Changes:
- Replace silent “no matching group” rendering with a thrown error in all
FelixConfigcomponent copies (current + versioned docs). - Update affected
FelixConfig name='…'lookup keys in multiplefelixconfig.mdxpages (current + versioned) to restore exact matches against generatedconfig-params.json.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| calico/reference/resources/felixconfig.mdx | Updates FelixConfig group lookup keys to match config-params.json. |
| calico/_includes/components/FelixConfig/index.js | Throws on unresolved group lookup to fail the build loudly. |
| calico-enterprise/reference/resources/felixconfig.mdx | Updates FelixConfig group lookup keys to match config-params.json. |
| calico-enterprise/_includes/components/FelixConfig/index.js | Throws on unresolved group lookup to fail the build loudly. |
| calico-enterprise_versioned_docs/version-3.23-2/reference/resources/felixconfig.mdx | Updates FelixConfig group lookup keys to match config-params.json. |
| calico-enterprise_versioned_docs/version-3.23-2/_includes/components/FelixConfig/index.js | Throws on unresolved group lookup to fail the build loudly. |
| calico-enterprise_versioned_docs/version-3.22-2/reference/resources/felixconfig.mdx | Updates FelixConfig group lookup keys to match config-params.json. |
| calico-enterprise_versioned_docs/version-3.22-2/_includes/components/FelixConfig/index.js | Throws on unresolved group lookup to fail the build loudly. |
| calico-enterprise_versioned_docs/version-3.21-2/reference/resources/felixconfig.mdx | Updates FelixConfig group lookup keys to match config-params.json. |
| calico-enterprise_versioned_docs/version-3.21-2/_includes/components/FelixConfig/index.js | Throws on unresolved group lookup to fail the build loudly. |
| calico-cloud/_includes/components/FelixConfig/index.js | Throws on unresolved group lookup to fail the build loudly. |
| calico-cloud_versioned_docs/version-22-2/_includes/components/FelixConfig/index.js | Throws on unresolved group lookup to fail the build loudly. |
| calico_versioned_docs/version-3.32/reference/resources/felixconfig.mdx | Updates FelixConfig group lookup keys to match config-params.json. |
| calico_versioned_docs/version-3.32/_includes/components/FelixConfig/index.js | Throws on unresolved group lookup to fail the build loudly. |
| calico_versioned_docs/version-3.31/reference/resources/felixconfig.mdx | Updates FelixConfig group lookup keys to match config-params.json. |
| calico_versioned_docs/version-3.31/_includes/components/FelixConfig/index.js | Throws on unresolved group lookup to fail the build loudly. |
| calico_versioned_docs/version-3.30/reference/resources/felixconfig.mdx | Updates FelixConfig group lookup keys to match config-params.json. |
| calico_versioned_docs/version-3.30/_includes/components/FelixConfig/index.js | Throws on unresolved group lookup to fail the build loudly. |
| calico_versioned_docs/version-3.29/reference/resources/felixconfig.mdx | Updates the Wireguard lookup key to match config-params.json. |
| calico_versioned_docs/version-3.29/_includes/components/FelixConfig/index.js | Throws on unresolved group lookup to fail the build loudly. |
| const FelixConfig = ({ configType, name }) => { | ||
| const matchedGroup = jsonData.Groups.find((group) => group.Name === name); | ||
| // Debugging logs | ||
|
|
||
| if (!matchedGroup) { | ||
| return <p>No matching group found for '{name}'.</p>; | ||
| // Fail the build loudly rather than silently dropping the group's fields. | ||
| // `name` must exactly match a group Name in config-params.json, which is | ||
| // auto-synced from the Felix source repos. A prose/casing sweep once | ||
| // restyled these lookup keys and silently dropped fields (DOCS-2970). | ||
| throw new Error( | ||
| `FelixConfig: no group named '${name}' in config-params.json. The 'name' ` | ||
| + `prop must exactly match a group Name in config-params.json; do not ` | ||
| + `restyle it as prose.` | ||
| ); |
The node/felix configuration.mdx page (config-file/env-var view) also consumes the FelixConfig component, using double-quoted name attributes. In calico version-3.29 its config-params.json uniquely uses the "Data plane" spelling, so the page's "Dataplane: ..." lookup keys never matched -- a pre-existing mismatch the silent fallback was hiding. Align those 7 keys with 3.29's own config-params.json. Verified all 22 FelixConfig-consuming pages (both quote styles) now resolve. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The FelixConfig component previously degraded silently: when a group name lookup missed, it rendered a small "No matching group found" paragraph that was easy to overlook. That is exactly how a prose/casing style sweep dropped iptablesRefreshInterval and 7 other groups from the FelixConfiguration reference without anyone noticing until a customer RCA. Turn that silent miss into a thrown error so a broken lookup fails the Docusaurus build instead of shipping a page with missing fields. This guards against every cause -- Vale-driven sweeps, manual edits, refactors, or a config-params.json regen that renames a group -- not just the one that triggered DOCS-2970. Applied to all FelixConfig component copies (current + versioned_docs across calico, calico-enterprise, calico-cloud) since style sweeps edit versioned pages too. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fe1308b to
2a840c8
Compare

Why
Follow-up hardening for the FelixConfiguration content fix (#2819, DOCS-2970).
The
FelixConfigcomponent degraded silently: when a group-name lookup missed, it rendered a small "No matching group found" paragraph that was easy to overlook. That's exactly how a prose/casing style sweep droppediptablesRefreshIntervaland 7 other groups from the reference page without anyone noticing until the Visa RCA (CI-2011).Change
Turn the silent miss into a thrown error, so a broken lookup fails the Docusaurus build instead of shipping a page with missing fields:
This guards against every cause — Vale-driven sweeps, manual edits, refactors, or a
config-params.jsonregen that renames a group — not just the one that triggered DOCS-2970. Applied to all component copies (current +versioned_docsacrosscalico,calico-enterprise,calico-cloud), since style sweeps edit versioned pages too.Pre-flight verified: all 22
<FelixConfig>pages in the repo currently resolve against their siblingconfig-params.json, so this does not break the build once #2819 lands.Stacks on #2819 — merge that first. This branch is based on #2819, so until it merges this PR's diff also shows the content fix; afterward it reduces to just the
index.jsguard. Merging this before #2819 would fail the build (the still-broken lookups onmain).🤖 Generated with Claude Code