Skip to content

fix(ci): populate frozen version content in preview build and surface fern errors#322

Merged
dmitsh merged 1 commit into
NVIDIA:mainfrom
pdmack:fix/fern-preview-frozen-versions
May 14, 2026
Merged

fix(ci): populate frozen version content in preview build and surface fern errors#322
dmitsh merged 1 commit into
NVIDIA:mainfrom
pdmack:fix/fern-preview-frozen-versions

Conversation

@pdmack

@pdmack pdmack commented May 14, 2026

Copy link
Copy Markdown
Contributor

Description

Two fixes for the Fern preview pipeline:

  1. Preview build missing frozen version content — Since fix(fern): pin frozen version content via git archive at publish time #316, fern/versions/v0.3.0.yml references v0.3.0-content/ which is populated by git archive at publish time. The preview build workflow (fern-docs-preview-build.yml) did not include this step, so the artifact shipped an empty directory. Every PR touching docs/ or fern/ has been failing preview generation since fix(fern): pin frozen version content via git archive at publish time #316 merged. Adds the same git archive loop from the publish workflow.

  2. Preview comment swallows fern errors — The Generate preview URL step in fern-docs-preview-comment.yml used OUTPUT=$(fern generate --docs --preview ... 2>&1), which swallows fern's error output on failure (bash -e aborts before echo "$OUTPUT" runs). Switches to tee-based streaming, matching the pattern already in the publish workflow since docs(fern): restore Reference section, label v0.3.0, surface errors #284.

Fixes #321

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.
  • All commits are signed off per DCO (git commit -s).

… fern errors

The preview build workflow did not run git archive to populate
fern/versions/v0.3.0-content/, causing fern generate --preview to fail
with ENOENT on every PR since NVIDIA#316 merged. Add the same git archive
step from the publish workflow.

Also switch the comment workflow's Generate preview URL step from the
OUTPUT=$(fern ... 2>&1) pattern to tee-based streaming so fern errors
are visible in the Actions log on failure.

Fixes NVIDIA#321

Signed-off-by: Pete MacKinnon <[email protected]>
@pdmack pdmack requested a review from dmitsh as a code owner May 14, 2026 18:50
@greptile-apps

greptile-apps Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes two independent regressions in the Fern documentation preview pipeline that have been affecting every docs-touching PR since #316. Both fixes align the preview workflows with patterns already established in the publish workflow.

  • Missing frozen version content: The fern-docs-preview-build.yml now runs the same git archive loop that the publish workflow uses to populate fern/versions/v*-content/ directories, so preview artifacts no longer ship with empty versioned-content directories.
  • Swallowed fern errors: fern-docs-preview-comment.yml replaces the command-substitution pattern (OUTPUT=$(... 2>&1)) — which causes bash -e to abort silently before the output is echoed — with a tee-based approach that streams output in real time, making failures visible in the step log.

Confidence Score: 5/5

Both changes are safe to merge; they restore expected behavior with no new logic beyond what already runs in the publish workflow.

The git archive loop is a direct copy of an already-proven pattern, complete with the existing guards for missing tags and the symlink creation for shared assets. The tee-based streaming change is a straightforward fix: output is written to a temp file and also streamed live, the URL is extracted from the file afterward, and the empty-URL guard is preserved. No new failure modes are introduced.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/fern-docs-preview-build.yml Adds 'Checkout frozen version content' step that mirrors the publish workflow's git archive loop, populating versioned docs content that was previously missing from preview artifacts.
.github/workflows/fern-docs-preview-comment.yml Replaces command-substitution capture of fern output with tee-based streaming so errors are visible when the command fails under bash errexit; adds pipefail to the step.

Reviews (1): Last reviewed commit: "fix(ci): populate frozen version content..." | Re-trigger Greptile

@github-actions

Copy link
Copy Markdown
Contributor

@dmitsh dmitsh merged commit 905ee0f into NVIDIA:main May 14, 2026
5 checks passed
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.

[BUG]: fern preview fails — frozen version content not populated in preview build

2 participants