Skip to content

docs(fern): restore Reference section, label v0.3.0, surface errors#284

Merged
dmitsh merged 3 commits into
NVIDIA:mainfrom
resker:docs/fern-nav-and-publish-fix
Apr 22, 2026
Merged

docs(fern): restore Reference section, label v0.3.0, surface errors#284
dmitsh merged 3 commits into
NVIDIA:mainfrom
resker:docs/fern-nav-and-publish-fix

Conversation

@resker
Copy link
Copy Markdown
Collaborator

@resker resker commented Apr 21, 2026

Description

Three related fixes to the Fern docs pipeline, each a small independent concern but cheap to bundle for review.

1. Restore Reference section to Fern nav

docs/reference/node-labels.md has been on main since #254 merged (2026-04-19) but is not listed in docs/index.yml (the Fern nav source-of-truth). The last successful Fern publish resolved 13 pages — exactly the count the nav declares without a Reference section — confirming the page is invisible on the live site despite being on the filesystem. Add a Reference section listing reference/node-labels.md. This is the paired-file update #254 should have included.

2. Label current version as v0.3.0

The published site shows a version label of dev because fern/docs.yml declared the only version as display-name: dev. The repo is at tagged release v0.3.0 with no divergence between released and in-flight docs, so dev is misleading. Rename to v0.3.0. When content actually diverges later (post-v0.4.0 breaking doc changes, or a doc change that only applies to the future release), re-introduce a separate dev entry alongside v0.3.0 and repoint paths.

Also drops the pre-existing /topograph/dev/index.html/topograph/dev/ redirect since the /dev/ destination no longer exists after the rename. Not adding /dev → new-version forwarding: site has only been live since 2026-04-17 (four days), so dev-URL bookmarks are unlikely; the Fern root redirect + sidebar recover any user who lands on a 404. If dead-bookmark reports surface later, adding a one-line redirect is trivial.

3. Surface fern errors in publish workflow

The publish step used OUTPUT=$(fern generate --docs 2>&1) to capture fern's output for URL-extraction, but on non-zero exit bash -e aborted the step before the subsequent echo "$OUTPUT" ran. Every failed publish between 2026-04-17 and 2026-04-20 (three from PR merges, several manual dispatches) logged only "Process completed with exit code 1" — zero diagnostic context. Switch to tee-based streaming so fern's stdout/stderr reaches the Actions log directly on both success and failure paths. set -o pipefail preserves step-failure behavior; || true on grep ensures a missing URL in fern's output does not fail the step on its own.

Net effect: future publish failures are diagnosable from the Actions log directly. No behavior change on the success path.

Validation

  • fern check passes (0 errors; 1 pre-existing NVIDIA-green-contrast warning unrelated to this PR)
  • Local fern docs dev renders the sidebar with all five sections (Getting Started, Architecture, Providers, Engines, Reference)
  • /topograph/reference/node-labels-and-annotations serves HTTP 200 on the local dev server
  • Version label reads v0.3.0 in the rendered site
  • Workflow error-surfacing behavior will be verifiable on any future failed publish (no way to fabricate a deliberate fern error locally for this test)

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes. (Validation via fern check + local fern docs dev; workflow fix is diagnostic plumbing with no behavioral change on the success path.)
  • The documentation is up to date with these changes. (This PR is the documentation update — the nav restoration and version label are themselves the doc fixes.)
  • All commits are signed off per DCO (git commit -s).

resker added 3 commits April 21, 2026 00:20
`docs/reference/node-labels.md` has been on main since PR NVIDIA#254 merged
(2026-04-19) but is not listed in `docs/index.yml`, the Fern nav
source-of-truth. The last successful Fern publish (2026-04-20T16:52Z)
resolved 13 pages — exactly the count declared in the nav without a
Reference section — confirming the page is invisible on the live site
at https://topograph.docs.buildwithfern.com/topograph despite being on
the filesystem.

Add a Reference section listing `reference/node-labels.md`. This is the
paired-file update that PR NVIDIA#254 should have included.

Verified filesystem vs. nav discrepancy:

| docs/ file                       | In index.yml? |
|----------------------------------|---------------|
| overview.md                      | yes           |
| architecture.md + api.md         | yes           |
| providers/{aws,gcp,oci,nebius,...| yes (7)       |
| engines/{slurm,k8s,slinky}.md    | yes (3)       |
| reference/node-labels.md         | NO (fixed)    |

Signed-off-by: Rob Esker <resker@nvidia.com>
The published Fern site shows a version label of "dev" because
`fern/docs.yml` declared the only version as `display-name: dev`. The
repo is at tagged release v0.3.0 with no divergence between the released
content and the in-flight docs, so "dev" is misleading: readers see
"development docs" framing when what they're actually looking at
corresponds to the v0.3.0 tag.

Rename the version to `v0.3.0`. No content split yet — both versions
would point at the same `docs/index.yml` anyway. When content actually
diverges (post-v0.4.0 breaking doc changes, or a doc change that only
applies to the future release), re-introduce a separate `dev` entry
alongside v0.3.0 and repoint paths to differentiated content.

Drop the pre-existing `/topograph/dev/index.html` -> `/topograph/dev/`
redirect because the `/dev/` destination no longer exists after the
rename. Not adding `/dev` -> new-version forwarding: site has only
been live since 2026-04-17 (four days), so dev-URL bookmarks are
unlikely; the Fern root redirect + sidebar navigation recovers any
user who lands on a 404. If dead-bookmark complaints surface later,
adding a one-line redirect is trivial.

Verified: `fern check` reports 0 errors (1 pre-existing warning about
the NVIDIA-green accent-color contrast ratio, unrelated to this PR).
`fern docs dev` renders the sidebar with all five sections intact
(Getting Started, Architecture, Providers, Engines, Reference) and
the version label reads "v0.3.0".

Signed-off-by: Rob Esker <resker@nvidia.com>
The publish step used `OUTPUT=$(fern generate --docs 2>&1)` to capture
fern's output so the script could grep for the "Published docs to" URL
and post it to the GitHub Actions step summary. Side effect: on
non-zero exit from `fern generate`, `bash -e` aborted the step BEFORE
the subsequent `echo "$OUTPUT"` ran, so fern's error output never
reached the Actions log. All three failed publishes between 2026-04-17
and 2026-04-20 (plus the 2026-04-18 manual dispatches) logged only
"Process completed with exit code 1" with no diagnostic context.

Switch to `fern generate ... 2>&1 | tee /tmp/fern-output.log`. The
`tee` streams fern's stdout/stderr to the Actions log in real time
(visible in both success and failure cases) and mirrors to a file that
the URL-extraction grep reads after. `set -o pipefail` is added so the
step still fails on fern's non-zero exit (tee's own exit status would
otherwise mask it). The `|| true` on grep ensures a missing URL in
fern's output does not fail the step on its own.

Net effect: future publish failures are diagnosable from the Actions
log directly. No behavior change on the success path.

No ability to test the failure path locally without reproducing a
deliberate fern error; validated only that the happy-path shell
snippet is syntactically valid. Future failures will surface the
actual fern error, which is the whole point.

Signed-off-by: Rob Esker <resker@nvidia.com>
@resker resker requested a review from dmitsh as a code owner April 21, 2026 05:31
@resker
Copy link
Copy Markdown
Collaborator Author

resker commented Apr 21, 2026

@pdmack — would appreciate your review on this one since it touches fern/ and .github/workflows/publish-fern-docs.yml (both areas you've been shepherding recently). Attempted to add you as a formal reviewer but the API rejects review requests from fork PRs; this comment is the next-best thing.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 21, 2026

Greptile Summary

This PR makes three small, independent fixes to the Fern docs pipeline: restores the missing Reference nav entry for node-labels.md, relabels the single version from dev to v0.3.0, and replaces the silent-on-failure output-capture pattern in the publish workflow with tee-based streaming so errors are visible in the Actions log. All changes are well-scoped and correctly reasoned.

Confidence Score: 5/5

Safe to merge — all three changes are low-risk doc/config fixes with clear rationale and no behavioral regression on the success path.

No P0 or P1 findings. The workflow change correctly preserves failure behavior via pipefail and tee; the nav and version-label changes are straightforward YAML edits validated with fern check and local dev server.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/publish-fern-docs.yml Replaces captured-variable pattern with tee-based streaming so fern errors appear in the Actions log on failure; pipefail + `
docs/index.yml Adds the missing Reference section pointing to reference/node-labels.md, which already exists on main but was absent from the nav.
fern/docs.yml Renames version display label from dev to v0.3.0 and removes the now-stale /topograph/dev/index.html redirect.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[fern generate --docs] -->|stdout plus stderr| B[tee fern-output.log]
    B -->|stream| C[Actions log visible on success AND failure]
    B -->|write| D[fern-output.log on disk]
    A -->|exit code via pipefail| E{Step exit check}
    E -->|non-zero| F[Step fails - log already streamed]
    E -->|zero| G[grep for Published URL]
    D --> G
    G -->|found| H[Write URL to GITHUB_STEP_SUMMARY]
    G -->|not found via or true| I[Skip summary, step continues]
Loading

Reviews (1): Last reviewed commit: "chore(ci): surface fern errors in publis..." | Re-trigger Greptile

@resker
Copy link
Copy Markdown
Collaborator Author

resker commented Apr 22, 2026

@pdmack - please advise

@dmitsh dmitsh merged commit a5dc3ca into NVIDIA:main Apr 22, 2026
6 checks passed
dmitsh pushed a commit that referenced this pull request Apr 29, 2026
PR #268 removed the `branches: [main]` push filter from
`publish-fern-docs.yml` while keeping the `tags: [docs/v*]` filter. With
GitHub Actions, defining `tags:` without a corresponding `branches:`
restricts push events to tag refs only — branch pushes (including main)
no longer trigger the workflow even when their changed paths match the
`paths:` filter.

Symptom: the live Fern site at
https://topograph.docs.buildwithfern.com/topograph has not been
republished since the manual workflow_dispatch on 2026-04-20T16:51Z.
PRs #284, #289, #290, #291, and #292 all touched docs/ but produced
zero workflow runs. The Reference section restored by #284 (and the
clique-semantics clarifications added by #289) are on main but invisible
on the published site.

Restore `branches: [main]` so push events to main with docs/ or fern/
changes resume triggering publishes. Tag pushes for `docs/v*` and manual
`workflow_dispatch` continue to work unchanged.

To clear the backlog after this PR merges, dispatch the workflow
manually one time:

  gh workflow run publish-fern-docs.yml --repo NVIDIA/topograph --ref main

Signed-off-by: Rob Esker <resker@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