fix(docs): populate fern version selector - #902
Conversation
Signed-off-by: Matt Kornfield <mkornfield@nvidia.com>
📝 WalkthroughWalkthroughChangesFern release documentation publishing
Sequence Diagram(s)sequenceDiagram
participant Workflow as publish-fern-docs.yaml
participant Script as materialize-release-versions.mjs
participant Git as Git tags
participant Fern as Fern docs configuration
Workflow->>Script: Run materialize:versions
Script->>Git: Discover eligible tags
Git-->>Script: Return tagged docs
Script->>Script: Generate snapshots and rewrite navigation
Script->>Fern: Update docs.yml
Fern-->>Workflow: Provide generated publishing inputs
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/publish-fern-docs.yaml:
- Around line 49-56: Add an npm ci step in the publish workflow after the Setup
Node.js step and before the “Materialize release versions” step, using docs/fern
as its working directory so npm run materialize:versions has its yaml dependency
installed.
In `@docs/fern/README.md`:
- Around line 93-107: Separate release versioning guidance by Diataxis type: in
docs/fern/README.md lines 93-107, retain only a concise reference overview and
cross-link a dedicated HOW-TO; move local materialization and preview
instructions there. In docs/AGENTS.md lines 20-27, retain the publication rule
and link to the same HOW-TO without duplicating operational steps. Ensure the
HOW-TO lists prerequisites first and ends with a Next Steps section.
In `@docs/fern/scripts/materialize-release-versions.mjs`:
- Around line 191-195: Update the version navigation generation around
versionYmlPath and writeFileSync to detect an existing file before writing; if
it lacks generatedFileHeader, fail instead of overwriting it. Preserve existing
generated files, and ensure updateDocsYml does not replace entries backed by
hand-authored version nav files.
- Around line 100-107: Update the version metadata construction around
displayName, slug, and dirName so prerelease tags retain their full normalized
version in the generated path instead of collapsing to the final release path.
Ensure generated paths are validated for uniqueness and reject duplicate paths
before materialization, while preserving existing final-release naming behavior.
- Around line 95-97: Classify prereleases using the parsed SemVer prerelease
component rather than checking for any hyphen: update isPrerelease in
materialize-release-versions.mjs while preserving stable build-metadata tags.
Also update .github/workflows/publish-fern-docs.yaml lines 26-27 to use the same
eligibility logic instead of hyphen-based exclusion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 658e0f95-6cfd-4bca-a5ac-0305948056b8
⛔ Files ignored due to path filters (1)
docs/fern/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (6)
.github/workflows/publish-fern-docs.yaml.gitignoredocs/AGENTS.mddocs/fern/README.mddocs/fern/package.jsondocs/fern/scripts/materialize-release-versions.mjs
|
Signed-off-by: Matt Kornfield <mkornfield@nvidia.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/fern/scripts/materialize-release-versions.mjs`:
- Around line 28-32: Update the publish-fern-docs workflow to install
dependencies in docs/fern before invoking materialize:versions, ensuring the
yaml import in materialize-release-versions.mjs resolves on a clean runner.
After materialization, run make docs-check as part of the workflow.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: bcadbd06-a26c-408a-b0f5-002524a80d70
📒 Files selected for processing (2)
docs/fern/scripts/materialize-release-versions.mjsdocs/fern/scripts/sync-helm-docs.mjs
Signed-off-by: Matt Kornfield <mkornfield@nvidia.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/publish-fern-docs.yaml:
- Around line 69-71: Add a separate broken-link validation step before the
Publish Docs step in the workflow, alongside the existing Check Fern docs step,
running make docs-broken-links under the same release eligibility condition.
Preserve the existing make docs-check step and ensure both documentation checks
complete before publishing.
- Around line 57-62: Update the --check-tag handling in
materialize-release-versions.mjs to reuse the tagged-navigation eligibility
check used by discoverReleaseTags(), including requiring the corresponding
docs/fern/versions/latest.yml file. Ensure the release-tag workflow step
consumes this aligned result so tags without the latest.yml snapshot are not
treated as eligible.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: ef0bdff1-0def-4142-a714-137c02379bec
📒 Files selected for processing (2)
.github/workflows/publish-fern-docs.yamldocs/fern/scripts/materialize-release-versions.mjs
🚧 Files skipped from review as they are similar to previous changes (1)
- docs/fern/scripts/materialize-release-versions.mjs
Summary by CodeRabbit
New Features
Documentation
docs/fern/layout, and added troubleshooting for missing release versions.Bug Fixes
Chores