Skip to content

docs(fern): main + latest GA alias, rename v0.2 → v0.2.1, fix CI fork-secret access#1241

Open
lbliii wants to merge 9 commits intomainfrom
lbliii/fern-latest-main-versioning
Open

docs(fern): main + latest GA alias, rename v0.2 → v0.2.1, fix CI fork-secret access#1241
lbliii wants to merge 9 commits intomainfrom
lbliii/fern-latest-main-versioning

Conversation

@lbliii
Copy link
Copy Markdown
Contributor

@lbliii lbliii commented May 6, 2026

Summary

image
  • Restructure Fern versions so `latest` is a GA alias rather than its own folder. New layout:
    • `fern/versions/main/` — bleeding-edge tree (was `latest/`)
    • `fern/versions/v0.2.1/` — frozen GA snapshot (was `v0.2/`; corrected version number)
    • `fern/versions/latest.yml` — GA alias mirroring `v0.2.1.yml` content; on each GA release we copy the new GA's yaml here, no separate folder
    • `fern/versions/main.yml` + `fern/versions/v0.2.1.yml` — nav trees with paths updated to point at their respective folders
  • `docs.yml` versions list is now `Latest (stable)` + `Main (beta)` + `0.2.1 (stable)`. The legacy `/v0.2/` HTML redirect updates to `/v0.2.1/`.
  • Body MDX cross-links: `/latest/` → `/main/` inside `main/`; `/latest/` and `/v0.2/` → `/v0.2.1/` inside `v0.2.1/`. `_nav_order.yml` retargets `./versions/main/pages/...`.
  • CI fork-secret fix (Charlie's recommendation): switch `.github/workflows/fern-docs-ci.yml` from `pull_request` to `push: branches: [pull-request/[0-9]+]`, matching `build-docs.yml`. The FW-CI mirror bot is already wired up for this repo, so fork PRs that touch `fern/**` will now run `fern check` in the trusted base-repo context with `DOCS_FERN_TOKEN` available. The preview build/comment pair is unchanged — it's already fork-safe via the `pull_request` + `workflow_run` split.
  • `.claude/skills/nemo-gym-docs/SKILL.md` rewritten for the new layout: edits default to `main/`, back-ports to GA snapshots are explicit, and the release ritual is documented (snapshot `main/` → `v/`, copy that yaml content into `latest.yml`).

Release ritual (now codified in SKILL.md)

On cutting v0.3.0:

  1. `cp -r fern/versions/main fern/versions/v0.3.0`
  2. `cp fern/versions/main.yml fern/versions/v0.3.0.yml`, rewrite `./main/` paths → `./v0.3.0/`
  3. Inside the new `v0.3.0/pages/` MDX bodies, replace any `/main/` link prefixes with `/v0.3.0/`
  4. Copy `v0.3.0.yml` content into `latest.yml` (paths unchanged)
  5. Update `docs.yml` versions list
  6. `main/` keeps moving forward

Test plan

  • `cd fern && npm run check` passes locally — 0 errors, 2 pre-existing warnings (FDR 403 on `missing-redirects`, accent-color contrast)
  • Confirm Fern preview comment renders `/main/`, `/v0.2.1/`, and `/latest/` URLs correctly
  • Confirm the published site nav shows Latest + Main (beta) + 0.2.1 after merge
  • After merge, verify a fork PR touching `fern/**` triggers the `Fern docs (check)` job via the mirrored `pull-request/` branch and the job has `DOCS_FERN_TOKEN` available

🤖 Generated with Claude Code

lbliii and others added 2 commits May 6, 2026 14:12
…lias, rename v0.2 → v0.2.1

Reshape the Fern versions tree so "latest" is a GA alias rather than a
real folder. New layout:

- versions/main/   — bleeding-edge tree (was versions/latest/)
- versions/v0.2.1/ — frozen GA snapshot (was versions/v0.2/, version was wrong)
- versions/latest.yml — GA alias mirroring v0.2.1.yml; on release, copy
  the new GA's yaml content here
- versions/main.yml + versions/v0.2.1.yml — nav trees with paths updated

Body MDX cross-links updated: /latest/ → /main/ inside main/, and
/latest/ + /v0.2/ → /v0.2.1/ inside v0.2.1/. _nav_order.yml retargets
main/. docs.yml versions list is now Latest (stable) + Main (beta) +
0.2.1 (stable); the v0.2 redirect updates to v0.2.1.

Also switch fern-docs-ci.yml from `pull_request` to
`push: branches: [pull-request/[0-9]+]`, matching build-docs.yml.
This routes fork PRs through the FW-CI mirror bot so DOCS_FERN_TOKEN
is available in CI for `fern check`.

SKILL.md (nemo-gym-docs) rewritten: edits default to main/, back-ports
to GA snapshots are explicit, release ritual snapshots main/ → v<new>/
and copies that yaml content into latest.yml.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Lawrence Lane <llane@nvidia.com>
Companion to the previous commit. The previous commit captured the
git mv renames; this one captures the content edits that followed:

- main.yml — paths flipped from ./latest/pages/... to ./main/pages/...
- v0.2.1.yml — paths flipped from ./v0.2/pages/... to ./v0.2.1/pages/...
- latest.yml — new GA alias file (mirrors v0.2.1.yml; has a header
  comment describing the alias contract)
- _nav_order.yml — paths retargeted to ./versions/main/pages/...
- docs.yml — versions list bumped to Latest/Main/0.2.1; v0.2 redirect → v0.2.1
- main/pages/**/*.mdx — body link prefixes /latest/ → /main/
- v0.2.1/pages/**/*.mdx — body link prefixes /latest/ and /v0.2/ → /v0.2.1/
- .claude/skills/nemo-gym-docs/SKILL.md — flow rewrite for the new layout
- .github/workflows/fern-docs-ci.yml — switch to push:pull-request/[0-9]+

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Lawrence Lane <llane@nvidia.com>
@lbliii lbliii requested a review from a team as a code owner May 6, 2026 18:14
@lbliii lbliii requested review from bxyu-nvidia and cmunley1 May 6, 2026 18:18
@lbliii
Copy link
Copy Markdown
Contributor Author

lbliii commented May 6, 2026

also addresses #723

…in-versioning

Signed-off-by: Lawrence Lane <llane@nvidia.com>

# Conflicts:
#	fern/versions/main/pages/environment-tutorials/designing-customer-evaluation.mdx
@cwing-nvidia cwing-nvidia self-requested a review May 7, 2026 03:12
Copy link
Copy Markdown
Contributor

@cwing-nvidia cwing-nvidia left a comment

Choose a reason for hiding this comment

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

  1. Missing redirect for /v0.2/ — The existing docs.yml updates the v0.2/:path*/index.html redirect to v0.2.1/, but there's no general /v0.2/:path* → /v0.2.1/:path* redirect. E.g anyone with bookmarks to /v0.2/get-started/quickstart (not .html) would get a 404. I'd add:
  • source: "/v0.2/:path*"
    destination: "/v0.2.1/:path*"
  1. The latest.yml --> v0.2.1/ alias pattern is clean. Could we do the same for main? i.e. create main.yml pointing at the existing ./latest/pages/... folder, skip the rename, and significantly reduce the dif making it easier to review. The folder name being latest/ vs main/ is cosmetic — the slug comes from docs.yml, not the folder — and we can always rename later in a standalone PR if we really want folder/slug parity.

That would also let us split this into two smaller, independently reviewable PRs:

  • v0.2 → v0.2.1 rename + latest.yml alias + CI fix
  • (optional, later) rename latest/ folder to main/ if we decide the cosmetics matter

….yml

Revert the cosmetic latest/ → main/ folder rename (and the body link
rewrites that came with it) per Chris's review. The folder name doesn't
affect public URLs — slugs come from docs.yml — so keeping the folder
named latest/ shrinks the diff dramatically without changing behavior.

End state in this PR (vs origin/main):
- versions/main.yml: new nav for the bleeding-edge train, mounts
  ./latest/pages (slug: main, beta)
- versions/latest.yml: rewritten as a GA alias mirroring v0.2.1.yml,
  mounts ./v0.2.1/pages (slug: latest, stable)
- versions/v0.2/ → versions/v0.2.1/ (folder + yaml rename, paths fixed)
- docs.yml: versions list adds Main; v0.2 redirect updated to v0.2.1; new
  /v0.2/:path* → /v0.2.1/:path* redirect catches non-.html bookmarks
- .github/workflows/fern-docs-ci.yml: switch to push:pull-request/[0-9]+
  so DOCS_FERN_TOKEN is available for fork PRs
- SKILL.md: documents the new model and release ritual

The folder name latest/ is now historical (slug: main); a future PR can
do the cosmetic rename in isolation if desired.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Lawrence Lane <llane@nvidia.com>
@lbliii
Copy link
Copy Markdown
Contributor Author

lbliii commented May 7, 2026

Thanks for the review @cwing-nvidia! Addressed both:

1. Missing /v0.2/:path* redirect — added in docs.yml:

- source: "/v0.2/:path*"
  destination: "/v0.2.1/:path*"

Catches any non-.html bookmarks (e.g. /v0.2/get-started/quickstart). Placed before the :path*/index.html rules.

2. Skip the latest/ → main/ folder rename — done. The folder stays named fern/versions/latest/; the new main.yml mounts ./latest/pages and gets the main slug via docs.yml. As you noted, the name vs. slug parity is cosmetic and we can do the folder rename in a follow-up PR if we ever want it.

End-state diff vs main is now 78 files (160/-77) — almost all of which are zero-change renames from v0.2/v0.2.1/. Down from 119 files (654/-573) before. Should be much easier to scan.

Force-push was blocked by branch rules so the prior 3 commits + merge are still in the history, with one new commit on top that walks the cosmetic rename back. The cumulative PR diff is what reviewers see, and that's now the small one.

Comment thread .claude/skills/nemo-gym-docs/SKILL.md Outdated
Comment thread fern/versions/latest.yml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is it possible to define the version once as a variable so it can be changed just once in each path?

Comment thread .claude/skills/nemo-gym-docs/SKILL.md Outdated
Comment thread .claude/skills/nemo-gym-docs/SKILL.md Outdated
lbliii added 2 commits May 7, 2026 17:24
…asing

- Replace fern/versions/latest.yml with a symlink to v0.2.1.yml so the GA
  alias has one source of truth; release ritual becomes one ln -sfn.
- Generalize SKILL.md phrasing to drop hard-coded version references and
  the legacy Sphinx/migration framing; clarify that frontmatter position
  is optional.
- Delete the orphaned fern/versions/_nav_order.yml — its consumer
  (add_frontmatter.py) is no longer in the repo and Fern doesn't read it.

Signed-off-by: Lawrence Lane <llane@nvidia.com>
lbliii added a commit to NVIDIA-NeMo/Automodel that referenced this pull request May 8, 2026
… site

Adds the bundled Fern CI suite from the convert-to-fern toolkit and the
`experimental.basepath-aware: true` flag required for subpath-hosted
sites (docs.nvidia.com/nemo/automodel).

- fern-docs-ci.yml — `fern check` on PRs. Trigger uses the FW-CI mirror
  bot pattern (`push: branches: pull-request/[0-9]+`) — same as
  build-docs.yml — so DOCS_FERN_TOKEN is available even for fork PRs.
  This is the fix landed in NVIDIA-NeMo/Gym#1241.
- fern-docs-preview-build.yml + fern-docs-preview-comment.yml —
  two-workflow split: build collects PR sources without secrets (safe
  for forks), comment workflow is triggered via workflow_run with the
  trusted base context, builds the preview, and posts a herb-emoji PR
  comment.
- publish-fern-docs.yml — publishes to docs.nvidia.com/nemo/automodel
  on push to main with fern/** changes or via workflow_dispatch.

Required org secret: DOCS_FERN_TOKEN (already present for build-docs.yml).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
lbliii added a commit to NVIDIA-NeMo/Automodel that referenced this pull request May 8, 2026
… site

Adds the bundled Fern CI suite from the convert-to-fern toolkit and the
`experimental.basepath-aware: true` flag required for subpath-hosted
sites (docs.nvidia.com/nemo/automodel).

- fern-docs-ci.yml — `fern check` on PRs. Trigger uses the FW-CI mirror
  bot pattern (`push: branches: pull-request/[0-9]+`) — same as
  build-docs.yml — so DOCS_FERN_TOKEN is available even for fork PRs.
  This is the fix landed in NVIDIA-NeMo/Gym#1241.
- fern-docs-preview-build.yml + fern-docs-preview-comment.yml —
  two-workflow split: build collects PR sources without secrets (safe
  for forks), comment workflow is triggered via workflow_run with the
  trusted base context, builds the preview, and posts a herb-emoji PR
  comment.
- publish-fern-docs.yml — publishes to docs.nvidia.com/nemo/automodel
  on push to main with fern/** changes or via workflow_dispatch.

Required org secret: DOCS_FERN_TOKEN (already present for build-docs.yml).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Lawrence Lane <llane@nvidia.com>
lbliii added a commit to NVIDIA-NeMo/Automodel that referenced this pull request May 8, 2026
…liases

Per the NeMo Gym pattern (NVIDIA-NeMo/Gym#1241): the bleeding-edge tree
that gets updated on every PR lives at versions/nightly/pages/, and
GA snapshots are cut from it at release time. The previous setup
labeled the same tree as "v0.4" — which was misleading because the
content is post-0.4.0-tag main, not the v0.4.0 release content.

- Renamed versions/v0.4/ → versions/nightly/ (all 130+ pages)
- Renamed versions/v0.4.yml → versions/nightly.yml (paths point at
  ./nightly/pages/ instead of ./v0.4/pages/)
- Recreated versions/latest.yml and versions/v0.4.yml as fresh copies
  of nightly.yml, both pointing at ./nightly/pages/. They serve as
  aliases until a real frozen v0.4.0 snapshot is migrated from the
  v0.4.0 git tag (out of scope for this PR).
- Reordered docs.yml versions: nightly (beta) listed first as the
  canonical/editable tree; Latest (stable) and "0.4.0 · 26.04"
  (stable) are now aliases.
- Updated fern/README.md and skills/fern-docs/SKILL.md to call
  nightly canonical and document the alias relationship + the
  cut-a-new-train cookbook (cp -r nightly v0.5; repoint latest).

Validation: all 5 primary + both secondary checks pass; URLMap still
resolves all 128 pages.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Lawrence Lane <llane@nvidia.com>
@lbliii lbliii requested review from anwithk and cwing-nvidia May 8, 2026 16:47
Orientation for the Fern docs site: layout, local dev via the (in-flight)
Make targets and the underlying npm scripts, authoring conventions
(frontmatter, components, internal links), versioning, CI workflows, and
a troubleshooting table covering the dashboard-provisioning HTTP 403 and
other common stumbles.

Signed-off-by: Lawrence Lane <llane@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants