Skip to content

fix(ci): add frozen version content to preview build and fix error handling#1285

Merged
lalitadithya merged 2 commits into
NVIDIA:mainfrom
pdmack:pdmack/fern-preview-fixes
May 14, 2026
Merged

fix(ci): add frozen version content to preview build and fix error handling#1285
lalitadithya merged 2 commits into
NVIDIA:mainfrom
pdmack:pdmack/fern-preview-fixes

Conversation

@pdmack

@pdmack pdmack commented May 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Two fixes for the Fern preview pipeline:

  1. Preview build missing frozen version content — Adds the git archive loop from the publish workflow so versioned docs (v1.2.0, v1.3.0, v1.4.0) are included in the preview artifact. Uses warning instead of error for missing tags.

  2. Preview comment swallows fern errors — Switches from OUTPUT=$(fern generate ... 2>&1) to tee-based streaming, matching the publish workflow pattern. Errors are now visible in CI logs.

Same issues found and fixed in NVIDIA/topograph#322.

Fixes #1284

Type of Change

  • 🐛 Bug fix
  • 🔨 Build/CI

Component(s) Affected

  • Documentation/CI

Testing

  • Manual testing completed
  • No breaking changes (or documented)

Checklist

  • Self-review completed
  • Ready for review

Summary by CodeRabbit

  • Bug Fixes
    • More reliable documentation previews: frozen-version docs are now detected and included when available, and missing versions are safely skipped with warnings.
    • Improved preview generation and publishing: command output is streamed to logs and parsed more robustly to extract published docs links.

Review Change Stack

…ndling

Preview build was missing the git archive step for frozen version
content (v1.2.0, v1.3.0, v1.4.0), so preview generation would fail
once DOCS_FERN_TOKEN is provisioned. Uses warning instead of error
for missing tags since preview shouldn't hard-fail.

Preview comment swallowed fern errors — OUTPUT=$(...) with bash -e
aborts before echo on failure. Switches to tee-based streaming,
matching the publish workflow pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2e774335-9878-42c7-a9ce-bd3f61097d87

📥 Commits

Reviewing files that changed from the base of the PR and between d74091e and 58613a1.

📒 Files selected for processing (2)
  • .github/workflows/fern-docs-preview-build.yml
  • .github/workflows/publish-fern-docs.yml
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/publish-fern-docs.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/fern-docs-preview-build.yml

📝 Walkthrough

Walkthrough

Adds extraction of frozen docs from git tags during preview artifact collection, streams fern generate output to a logfile with pipefail enabled for URL parsing, and changes the publish workflow's tag check to verify refs/tags/$version.

Changes

Fern Preview Pipeline

Layer / File(s) Summary
Frozen version archival in build step
.github/workflows/fern-docs-preview-build.yml
The collect job adds a step that archives and extracts docs/ from git tags referenced in fern/versions/v*.yml into fern/versions/${version}-content/; missing tags warn and are skipped.
Log-based output capture in comment step
.github/workflows/fern-docs-preview-comment.yml
The generate-docs step sets set -o pipefail, runs fern generate while teeing output to /tmp/fern-output.log, and extracts the published docs URL from that log file.
Tag existence check using full ref
.github/workflows/publish-fern-docs.yml
The publish workflow now verifies tag existence with git rev-parse -q --verify "refs/tags/$version" before creating/populating frozen docs content directories.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Poem

A rabbit found old docs in tags,
Packed them neat in versioned bags,
Pipes now fail when things go wrong,
Logs sing loud, a helpful song,
Hopping docs secure and glad. 🐰📜

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary changes: adding frozen version content to the preview build workflow and improving error handling via the tee-based output approach.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

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.

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 @.github/workflows/fern-docs-preview-build.yml:
- Around line 69-71: The script currently accepts any ref via git rev-parse
"$version" and then git archive "$version", which can pick up branches or
commits; change both checks to explicitly resolve tag refs (e.g., use
"refs/tags/$version" with git rev-parse --verify and git archive against the tag
ref) so the archive always uses the tag object; update the existence check that
uses git rev-parse and the git archive invocation (the two places referencing
"$version") to reference "refs/tags/$version" instead.
🪄 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: 16451141-4377-43bb-9bba-e9956975ef2d

📥 Commits

Reviewing files that changed from the base of the PR and between e774181 and d74091e.

📒 Files selected for processing (2)
  • .github/workflows/fern-docs-preview-build.yml
  • .github/workflows/fern-docs-preview-comment.yml

Comment thread .github/workflows/fern-docs-preview-build.yml Outdated
@github-actions

Copy link
Copy Markdown
Contributor

lalitadithya
lalitadithya previously approved these changes May 14, 2026
git rev-parse and git archive with bare version names could resolve
a branch instead of a tag if names collide. Use refs/tags/$version
to ensure we always archive from the tag object.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@pdmack

pdmack commented May 14, 2026

Copy link
Copy Markdown
Collaborator Author

Good catch on the explicit tag refs — fixed in both preview-build and publish workflows. Thanks @coderabbitai.

@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@pdmack: Glad it helped! Thanks for the quick fix across both workflows. 🙌

@lalitadithya lalitadithya enabled auto-merge (squash) May 14, 2026 21:15
@lalitadithya lalitadithya merged commit 6d95b9c into NVIDIA:main May 14, 2026
80 of 88 checks passed
@pdmack pdmack deleted the pdmack/fern-preview-fixes branch May 19, 2026 13:02
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 build missing frozen version content and swallowing errors

2 participants