feat(vcluster): automate kubernetes compatibility matrix#1706
feat(vcluster): automate kubernetes compatibility matrix#1706
Conversation
✅ Deploy Preview for vcluster-docs-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
cbron
left a comment
There was a problem hiding this comment.
Only skimmed most of it, but will be happy its autoamted.
Manually-maintained HTML compatibility matrix in supported_versions.mdx was last updated 3 months ago (PR #1198). Enterprise customers rely on this as source of truth for upgrade decisions, and stale data erodes trust. Replaced hardcoded HTML table with data-driven approach: - JSON data source at static/api/k8s-compatibility.json - React component KubernetesCompatibilityMatrix renders from JSON - Script generate-compatibility-matrix.js supports --add/--prune for managing versions while preserving existing test results - GitHub workflow validates JSON on PRs touching the data file Update workflow: edit JSON (or run script), push, CI validates. Closes DEVOPS-478
d6946ce to
a4f7977
Compare
|
@claude review |
|
Claude finished @Piotr1215's task in 2m 50s —— View job PR Review: feat(vcluster): automate kubernetes compatibility matrixTasks:
Overall this is a solid improvement — replacing 82 lines of static HTML with a data-driven component is the right move. The architecture is clean and the SKILL.md is excellent. A few things worth addressing before merging. Security:
|
| Host | Marked as tested | Should be tested |
|---|---|---|
| 1.32 | vcluster 1.33 | vcluster 1.32 |
| 1.31 | vcluster 1.32 | vcluster 1.31 |
| 1.30 | vcluster 1.31 | vcluster 1.30 |
If intentional (actual test results differ from diagonal), the data is correct but worth documenting. If unintentional, these three rows need updating.
Script: No version format validation
scripts/generate-compatibility-matrix.js:155-160
--add and --prune accept any string. --add foo or --add 1.35-alpha pass through silently. A simple guard would prevent corrupted data:
const VERSION_RE = /^\d+\.\d+$/;
if (!VERSION_RE.test(args[i + 1])) {
console.error(`Invalid version "${args[i + 1]}". Expected MAJOR.MINOR (e.g. 1.35)`);
process.exit(1);
}Tests: Anti-patterns and brittleness
tests/specs/k8s-compatibility-matrix.spec.js
-
waitForTimeoutanti-pattern (lines 25, 43, 53, 76): Fixed sleeps make tests slower and less reliable. Wait for specific element states instead. -
Hardcoded footnote text (line 61):
filter({ hasText: 'EndpointSlice' })breaks when note text changes. Prefer a structural locator. -
Screenshots directory (lines 64, 86): Will fail if
tests/screenshots/doesn't exist. Either add it to the repo or usefs.mkdirSync(..., { recursive: true }). -
Hardcoded
/next/path (line 12): SKILL.md notes this needs manual update after a version cut — add a code comment so it's harder to forget.
Component: Silent fallback for unknown status
src/components/KubernetesCompatibilityMatrix/index.jsx:34
const config = statuses[status] || statuses.compatible;An unrecognized status silently renders as "compatible". CI validation catches this, but a console.warn would help catch issues during local development.
Component: Accessibility
Status cells render raw emoji without accessible alternatives:
<td>{config.emoji}</td>title on a <td> is not reliably announced by screen readers. Consider <span role="img">{config.emoji}</span> inside the cell.
Things done well
compareVersionscorrectly handles1.9 < 1.10with numeric comparison.validate()checks row count, all cells present, valid statuses, and note references — comprehensive.- SKILL.md is well-written for AI-assisted future maintenance.
- MDX cleanup (82 lines → 1 import) is clean.
- CSS uses Docusaurus variables throughout, so dark mode works automatically.
215cb93 to
550e111
Compare
Content Description
Replace manually-maintained HTML compatibility matrix with a data-driven React component backed by JSON. Adds a generation script (
--add/--prune) and CI workflow for validation.Preview Link
Internal Reference
Closes DEVOPS-478
AI review: mention
@claudein a comment to request a review or changes. See CONTRIBUTING.md for available commands.@netlify /docs