Skip to content

docs(platform): add missing database field to platform config referen…#1945

Open
djwfyi wants to merge 6 commits intomainfrom
DOC-1313/platform-config
Open

docs(platform): add missing database field to platform config referen…#1945
djwfyi wants to merge 6 commits intomainfrom
DOC-1313/platform-config

Conversation

@djwfyi
Copy link
Copy Markdown
Collaborator

@djwfyi djwfyi commented Apr 15, 2026

Content Description

Regenerates autogenerated docs for 4.8.1.
Adds missing database field to platform conf reference (DOC-1313).

Bump github.com/loft-sh/api/v4 from v4.6.0 to v4.8.1 and regenerate platform API reference partials. This adds the missing database (DatabaseKine) config field to status_reference.mdx and reference.mdx, removes the now-deleted external config partials, and picks up other API additions (metal3 node provider, namespaceTemplate project field, DirectClusterEndpointToken rename).

Also fixes generator hardcoded title "Move VCluster" → "Move vCluster".

Preview Link

https://deploy-preview-1945--vcluster-docs-site.netlify.app/docs/platform/next/configure/platform-configs/overview#database

(Showing that the missing database field now exists.)

Internal Reference

Closes DOC-1313

AI review: mention @claude in a comment to request a review or changes. See CONTRIBUTING.md for available commands.

FORK LIMITATION: @claude does not work on pull requests opened from forks. GitHub Actions cannot access the required secrets for fork-originated PRs. To use AI review, push your branch directly to this repository.

@netlify /docs

…ce (DOC-1313)

Bump github.com/loft-sh/api/v4 from v4.6.0 to v4.8.1 and regenerate
platform API reference partials. This adds the missing `database`
(DatabaseKine) config field to status_reference.mdx and reference.mdx,
removes the now-deleted `external` config partials, and picks up other
API additions (metal3 node provider, namespaceTemplate project field,
DirectClusterEndpointToken rename).

Also fixes generator hardcoded title "Move VCluster" → "Move vCluster".

Closes DOC-1313

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@djwfyi djwfyi self-assigned this Apr 15, 2026
@djwfyi djwfyi requested a review from a team as a code owner April 15, 2026 21:12
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 15, 2026

Deploy Preview for vcluster-docs-site ready!

Name Link
🔨 Latest commit c950c0c
🔍 Latest deploy log https://app.netlify.com/projects/vcluster-docs-site/deploys/69e03d24eb47bf00085cb1cd
😎 Deploy Preview https://deploy-preview-1945--vcluster-docs-site.netlify.app/docs
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown
Contributor

djwfyi and others added 2 commits April 15, 2026 17:18
Document that github.com/loft-sh/api/v4 must be bumped to match the
new platform version before running the partials generator, so new
config fields are not silently omitted from the reference docs.

Also corrects the description of what the generator reads (Go types
primary, vCluster schema secondary).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… feature table

- Add .markdownlintignore to exclude vendor/ and node_modules/ from
  markdownlint, preventing noisy review comments on third-party files
- Scope misspell to docs directories only (vendor already excluded by vale)
- Re-sync FeatureTable in nodeprovider.mdx after generator regeneration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@djwfyi
Copy link
Copy Markdown
Collaborator Author

djwfyi commented Apr 15, 2026

CI failures — cause and fix

Actual build failure: validate-feature-tables

The partials generator (hack/platform/partials/main.go) regenerates platform/api/resources/nodeprovider.mdx from a template that doesn't include the FeatureTable component. When the generator ran as part of this PR, the previously hand-added FeatureTable names="auto-nodes-clusterapi" was removed, causing validate-feature-tables to fail.

Fixed in the latest commit by running npm run sync-feature-tables to re-insert it.

Long-term fix tracked in DOC-1315 — the FeatureTable (and similar hand-added sections in other generator-owned pages) needs to move into the generator template so it survives regeneration.

Noisy-but-not-failing: markdownlint/misspell on vendor files

The reviewdog linters were running against vendor/ files added by the go mod vendor update (e.g. vendor/github.com/spf13/cobra/README.md). These are third-party files — we should never be linting them. Both markdownlint and misspell checks showed ✅ pass, so these comments were not blocking, but they were alarming noise.

Fixed in the latest commit by:

  • Adding .markdownlintignore excluding vendor/ and node_modules/ (mirrors what vale already does via files_ignore)
  • Scoping the misspell action to docs directories only (platform/, vcluster/, versioned docs, docs/)

Versioned vCluster docs (0.28-0.30) import from
@site/platform/api/_partials/resources/config/external.mdx and
related sub-partials. The generator deleted these when it was
re-run against api/v4 v4.8.1, which no longer has the External
config field. Restoring them from the pre-bump state so the
cross-plugin imports in frozen versioned docs continue to resolve.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@djwfyi
Copy link
Copy Markdown
Collaborator Author

djwfyi commented Apr 16, 2026

Build fix: restored deleted external config partials

The generator deletes platform/api/_partials/resources/ with os.RemoveAll before regenerating, so when we bumped the API to v4.8.1 (which removed the External config field), the generator correctly stopped producing those files. But frozen versioned vCluster docs (0.28–0.30) have cross-plugin imports pointing at them:

@site/platform/api/_partials/resources/config/external.mdx
@site/platform/api/_partials/resources/config/external/platform.mdx
@site/platform/api/_partials/resources/config/external/platform/apiKey.mdx
@site/platform/api/_partials/resources/config/external/platform/autoDelete.mdx

Since those versioned docs are frozen and can't be modified, I restored the six deleted files from git history (the pre-bump state of the files is appropriate since they document a field that existed in the platform versions those docs cover).

Problem: this will happen again

Every future generator run will delete these files again. Two mitigations were considered:

Option A — Post-run restore (no code change)
After every generator run, add to the release process:

git checkout HEAD -- platform/api/_partials/resources/config/external*

Fragile: easy to forget, depends on the files being committed before the run.

Option B — Generator-level preserve list (implementing now)
Add a .generator-preserve manifest file inside platform/api/_partials/resources/ listing paths to skip during RemoveAll. The generator backs those up, runs RemoveAll, then restores them. The preserve file becomes the authoritative record of "files the generator deleted but versioned docs still need."

Implementing Option B in a follow-up commit on this branch.

The generator does os.RemoveAll on the entire partials directory before
regenerating. When an API field is removed, its partial files disappear
and break frozen versioned docs that still import them via @site/platform/...

Add removeAllExceptPreserved(): reads platform/api/_partials/resources/
.generator-preserve, backs up listed paths to a temp dir, runs RemoveAll,
then restores them. The manifest file itself is always restored too.

Seed the manifest with the external config partials (removed in api/v4
v4.8.1) that versioned vCluster docs 0.28-0.30 still import.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@djwfyi
Copy link
Copy Markdown
Collaborator Author

djwfyi commented Apr 16, 2026

Fix: generator now preserves legacy partials across runs

Implemented Option B from the previous comment.

What changed

hack/platform/partials/main.go — replaced the bare os.RemoveAll(util.BasePath) with removeAllExceptPreserved(), which:

  1. Reads platform/api/_partials/resources/.generator-preserve
  2. Backs up all listed paths (plus the manifest file itself) to a temp dir
  3. Runs os.RemoveAll
  4. Restores the backed-up files

platform/api/_partials/resources/.generator-preserve — new manifest file, seeded with the external config partials:

config/external.mdx
config/external/

For future cases

If a future API bump causes the generator to delete partials that frozen versioned docs still import, the fix is a one-line addition to .generator-preserve. No code change needed.

Scope

The restored external files only appear on pages that import them. No pages in the current platform/, vcluster/, Platform 4.8, or vCluster 0.33 docs import them — only frozen versioned docs 0.28–0.30, which is the intended audience for that content.

…se skill

Add guidance for identifying and handling partials deleted by the
generator that frozen versioned docs still import:

- Part 1: new step 5 with audit commands to check git-deleted files
  against versioned doc imports after running the generator
- API Partials Generation: document the .generator-preserve mechanism,
  its backup/restore behavior, and when to add entries
- Troubleshooting: add recipe for the "Cannot find module @site/platform/
  api/_partials/..." build failure with step-by-step resolution
- release-checklist.md: matching checklist item with audit commands

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@djwfyi
Copy link
Copy Markdown
Collaborator Author

djwfyi commented Apr 16, 2026

Release skill updated with .generator-preserve guidance

Updated .claude/skills/platform-docs-releaser/SKILL.md and references/release-checklist.md so future releases handle this class of problem proactively.

What was added

Part 1 — new audit step (step 5) run immediately after the generator:

# List files the generator deleted
git diff --name-status platform/api/_partials/resources/ | grep "^D"

# For each deleted path, check if any frozen versioned docs still import it
git diff --name-status platform/api/_partials/resources/ | grep "^D" | awk '{print $2}' | \
  xargs -I{} basename {} | \
  xargs -I{} grep -rl "{}" vcluster_versioned_docs/ --include="*.mdx"

If a match is found, add the path to .generator-preserve before committing.

API Partials Generation section — documents .generator-preserve: what it does, how the backup/restore works, and how to add entries (one-line, no code change required).

Troubleshooting section — new entry for Cannot find module @site/platform/api/_partials/... with the full resolution recipe: identify, add to preserve file, restore from git history, verify the file survives a re-run.

release-checklist.md — matching checklist item with the audit commands inline.

Copy link
Copy Markdown
Contributor

@Piotr1215 Piotr1215 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. One question about removed hand-written docs sections.

Comment thread platform/api/resources/clusterroletemplate.mdx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants