Skip to content

fix(ci): fix fern preview metadata and add continuous staging publish#546

Merged
dims merged 2 commits intoNVIDIA:mainfrom
pdmack:pdmack/fern-ci-fix
Apr 11, 2026
Merged

fix(ci): fix fern preview metadata and add continuous staging publish#546
dims merged 2 commits intoNVIDIA:mainfrom
pdmack:pdmack/fern-ci-fix

Conversation

@pdmack
Copy link
Copy Markdown
Contributor

@pdmack pdmack commented Apr 11, 2026

Summary

Fix two bugs in the Fern preview CI workflows, add offline link checking, and
extend the publish workflow to continuously deploy staging on docs commits to main.

Motivation / Context

The preview workflow was silently dropping PR metadata (PR_NUMBER empty,
HEAD_REF empty) because upload-artifact@v4 excludes hidden directories by
default. A second bug caused a corrupted GitHub API URL when posting the preview
comment. The publish workflow required a manual tag or dispatch to update the
docs site.

Fixes: N/A
Related: N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Build/CI/tooling

Component(s) Affected

  • Other: Fern docs CI (.github/workflows/fern-docs-*.yml, publish-fern-docs.yml)

Implementation Notes

  • .preview-metadata/ renamed to preview-metadata/upload-artifact@v4 sets
    include-hidden-files: false by default, silently excluding the directory from
    the artifact
  • COMMENT_ID=$(... | tr -d '\r' | head -1)gh api returns CRLF output;
    the trailing \r was included in the URL, causing
    parse "…/comments/{\r": invalid control character in URL
  • Lychee runs --offline (file refs only) to avoid flaky external URL checks
  • Publish concurrency group fern-publish with cancel-in-progress: true drops
    intermediate jobs on rapid merges to avoid consuming Fern API quota

Testing

CI-only change — no make qualify applicable. Workflows validated via
fern check (0 errors) and yamllint (0 errors).

Risk Assessment

  • Low — Isolated change, well-tested, easy to revert

Rollout notes: N/A

Checklist

  • Tests pass locally (make test with -race)
  • Linter passes (make lint)
  • I did not skip/disable tests to make CI green
  • I added/updated tests for new functionality
  • I updated docs if user-facing behavior changed
  • Changes follow existing patterns in the codebase
  • Commits are cryptographically signed (git commit -S)

@pdmack pdmack requested a review from a team as a code owner April 11, 2026 17:05
@dims dims enabled auto-merge (squash) April 11, 2026 17:15
@dims dims merged commit 42877f6 into NVIDIA:main Apr 11, 2026
18 checks passed
Copy link
Copy Markdown
Contributor

@yuanchen8911 yuanchen8911 left a comment

Choose a reason for hiding this comment

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

/lgtm

Non-blocking note: the fern-publish concurrency group is shared by both main branch publishes and docs/v* tag publishes, so a rare overlap could cause one to cancel the other. This is low risk because fern generate --docs is idempotent and these events are infrequent. If you want to avoid branch-vs-tag cross-cancellation, consider scoping the group by ref type, e.g. fern-publish-${{ github.ref_type }}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants