docs: prepare Fern docs workflow#622
Conversation
|
MkDocs preview: https://66bdd336.dd-docs-preview.pages.dev Fern preview: https://nvidia-preview-pr-622.docs.buildwithfern.com/nemo/datadesigner
|
PR #622 Review — docs: prepare Fern docs workflowSummaryThis PR lands the scaffolding needed to run the Fern docs stack alongside MkDocs for the next few releases: a Fern CI/publish workflow, a Dev-Notes-only publish workflow, Fern preview publishing in the existing 55 files changed; ~7k additions are dominated by new MDX recipe pages and regenerated notebook JSON/TS. Non-docs code is small. FindingsWorkflows
Makefile
Notebook pipeline
Fern content & routing
Non-docs production code
pyproject / dependencies
Risks
VerdictApprove (with optional follow-ups). This is a well-scoped docs-infrastructure PR. Workflow permissions are minimal, fork secrets are properly gated, the local-build Make targets are consistent with what CI runs, and the |
Greptile SummaryThis PR introduces the Fern docs publishing pipeline alongside the existing MkDocs path, adding CI workflows for full release publishing, a lightweight devnotes-only publish, and PR preview support. Generated Fern artifacts (notebook JSON/TS and API reference) are now gitignored and regenerated in CI or locally via new Make targets.
|
| Filename | Overview |
|---|---|
| .github/workflows/docs-preview.yml | Adds Fern preview deployment, concurrency cancellation, and fork-PR guards; check-fern-docs relies implicitly on the stub-notebook step running first since notebooks group is not installed. |
| .github/workflows/build-fern-docs.yml | New release/manual workflow that builds notebooks, checks Fern docs, and publishes; uses pinned action SHAs and validates FERN_TOKEN before publishing. |
| .github/workflows/publish-fern-devnotes.yml | Lightweight devnotes-only publish trigger; hard-fails if no prior successful docs build has notebook artifacts, which blocks initial bootstrap until build-fern-docs.yml runs first. |
| Makefile | Migrates docs tooling from uv run to .venv/bin/* paths, adds Fern-specific targets (check-fern-docs, serve-fern-docs-locally, generate-fern-api-reference), and changes convert-execute-notebooks to exit 1 on any notebook failure instead of printing a warning. |
| fern/scripts/ipynb-to-fern-json.py | Expands Colab cell detection from badge-only regex to metadata tag + multiple content patterns; renames is_colab_badge_cell to is_colab_injected_cell for accuracy. |
| docs/scripts/build_notebooks_cached.sh | Parameterizes jupytext path via DOCS_JUPYTEXT env var, adds pre-flight check for missing executable, and cleans the output dir before rebuilding. |
| fern/docs.yml | Adds v0.5.9 and 'Older versions' entries, updates display name to 'Latest · v0.5.9', and adds redirect for doubled older-versions slug and historical MkDocs archive routes. |
| fern/versions/latest.yml | Rolling 'latest' version mixes v0.5.8 pages for core content with v0.5.9 pages for new VLM recipes and latest/pages for dev notes; intentional design for incremental rollout. |
| pyproject.toml | Adds pinned py2fern==0.1.6 to the docs dependency group so API reference generation works without a Fern login. |
Sequence Diagram
sequenceDiagram
participant Push as Git Push / Release
participant BN as build-notebooks.yml
participant BFD as build-fern-docs.yml
participant PFD as publish-fern-devnotes.yml
participant DP as docs-preview.yml
participant Fern as Fern Docs (buildwithfern)
participant CF as Cloudflare Pages
Note over BFD,PFD: Release / workflow_dispatch
Push->>BFD: release:published or manual
BFD->>BN: reuse (build-notebooks)
BN-->>BFD: notebooks artifact
BFD->>BFD: make check-fern-docs
BFD->>Fern: fern generate --docs
Note over PFD: push to main (devnotes paths)
Push->>PFD: path filter matches
PFD->>BFD: gh run download notebooks artifact
PFD->>PFD: make check-fern-docs
PFD->>Fern: fern generate --docs
Note over DP: PR opened / updated
Push->>DP: pull_request event
DP->>DP: uv sync --group docs
DP->>DP: Create notebook stubs
DP->>DP: mkdocs build
DP->>DP: make check-fern-docs
alt same-repo PR
DP->>Fern: fern generate --preview (pr-N)
DP->>CF: wrangler pages deploy
DP->>DP: Post PR comment (MkDocs + Fern URLs)
else fork PR
DP->>DP: notice: skipping hosted previews
end
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
.github/workflows/docs-preview.yml:93-106
**Fern failure cascades to block MkDocs deploy and PR comment**
`Deploy Fern preview` sits before `Deploy to Cloudflare Pages` with no `continue-on-error` guard. GitHub Actions skips all subsequent steps when any step fails (the implicit `success()` condition applies even to steps with explicit event-based `if:` guards). A Fern API error, timeout, or token issue will therefore prevent the MkDocs site from being deployed *and* prevent the PR comment from being posted — silently dropping the MkDocs preview URL from the PR.
Adding `continue-on-error: true` to the Fern step lets the Cloudflare deploy and comment steps always run for same-repo PRs regardless of Fern's outcome.
Reviews (1): Last reviewed commit: "docs: clean older versions route" | Re-trigger Greptile
| - name: Deploy Fern preview | ||
| if: github.event.pull_request.head.repo.full_name == github.repository | ||
| id: fern-preview | ||
| env: | ||
| FERN_TOKEN: ${{ secrets.DOCS_FERN_TOKEN }} | ||
| run: | | ||
| if [ -z "$FERN_TOKEN" ]; then | ||
| echo "::error::DOCS_FERN_TOKEN secret is required to publish Fern preview docs." | ||
| exit 1 | ||
| fi | ||
|
|
||
| cd fern | ||
| npx -y fern-api@$(jq -r .version fern.config.json) generate --docs --preview --id pr-${{ github.event.pull_request.number }} --force --no-prompt | ||
| echo "url=https://nvidia-preview-pr-${{ github.event.pull_request.number }}.docs.buildwithfern.com/nemo/datadesigner" >> "$GITHUB_OUTPUT" |
There was a problem hiding this comment.
Fern failure cascades to block MkDocs deploy and PR comment
Deploy Fern preview sits before Deploy to Cloudflare Pages with no continue-on-error guard. GitHub Actions skips all subsequent steps when any step fails (the implicit success() condition applies even to steps with explicit event-based if: guards). A Fern API error, timeout, or token issue will therefore prevent the MkDocs site from being deployed and prevent the PR comment from being posted — silently dropping the MkDocs preview URL from the PR.
Adding continue-on-error: true to the Fern step lets the Cloudflare deploy and comment steps always run for same-repo PRs regardless of Fern's outcome.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/docs-preview.yml
Line: 93-106
Comment:
**Fern failure cascades to block MkDocs deploy and PR comment**
`Deploy Fern preview` sits before `Deploy to Cloudflare Pages` with no `continue-on-error` guard. GitHub Actions skips all subsequent steps when any step fails (the implicit `success()` condition applies even to steps with explicit event-based `if:` guards). A Fern API error, timeout, or token issue will therefore prevent the MkDocs site from being deployed *and* prevent the PR comment from being posted — silently dropping the MkDocs preview URL from the PR.
Adding `continue-on-error: true` to the Fern step lets the Cloudflare deploy and comment steps always run for same-repo PRs regardless of Fern's outcome.
How can I resolve this? If you propose a fix, please make it concise.
📋 Summary
This PR prepares DataDesigner's Fern docs workflow for local validation, preview, and publishing while keeping the existing MkDocs docs path active. The goal is to run both docs stacks for a few releases, validate Fern with real releases/dev notes, then cut over once the workflow is mature.
🔗 Related Issue
N/A
🔄 Changes
Added
DOCS_FERN_TOKEN:build-fern-docs.yml.publish-fern-devnotes.yml.v0.5.9,v0.5.8,latest, andOlder versionsentries, plus redirects for legacy MkDocs archives.README.md,CONTRIBUTING.md, andfern/README.md.Changed
docs/notebook_source/*.py.latest, with older posts still discoverable through the Dev Notes index./nemo/datadesigner/older-versions, with the previous doubled route redirected.Fixed
🔍 Attention Areas
py2fern==0.1.6so OSS contributors can run the local Fern API reference path without a Fern login. Andrew Schilling said Fern has promised a local-build solution without login; we should revisit this once available.DOCS_FERN_TOKEN; preview publishing is gated to same-repo PRs so fork PRs do not receive secrets.🧪 Testing
.venv/bin/ruff check --fix ..venv/bin/ruff format .make check-fern-docsmake serve-fern-docs-locallywith browser spot-checks for versions, Dev Notes, notebooks, recipes, API reference, and older-version routingnpx -y fern-api@4.106.0 generate --docsmake testpasses - not run locally; CI test matrix is passing✅ Checklist
Signed-off-bytrailersDescription updated with AI