Skip to content

ci(fern): track latest Fern CLI via npx instead of pinning - #1194

Merged
lbliii merged 5 commits into
mainfrom
lbliii/pr-1186-ci-check
May 1, 2026
Merged

lbliii merged 5 commits into
mainfrom
lbliii/pr-1186-ci-check

Conversation

@lbliii

@lbliii lbliii commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • fern-api was pinned at ^4.80.3 in fern/package.json. Fern ships several releases per day, and 4.x was treating a transient FDR 403 (a [missing-redirects] rule warning) as fatal — fern check exits 1 with no surface-level error, and fern generate --docs --preview fails the same way. This has broken every "Fern docs (check)" and "Preview Fern Docs: Comment" run since 2026-04-28 (e.g. PR docs: improve product overview #1186 has no preview comment because of it).
  • Verified locally: [email protected] check → exit 1, [email protected] check → exit 0 (same FDR 403 still appears in debug logs but is correctly downgraded to a warning).
  • Pinning means we'd need a Renovate/Dependabot loop to keep up. Simpler: don't pin. Drop the devDependency and lockfile, have npm scripts and the preview job shell out to npx -y fern-api@latest. CI and local dev always run current Fern, no maintenance.

Net diff: +10 / −242 lines (most of which is the deleted fern/package-lock.json).

Test plan

  • rm -rf fern/node_modules && cd fern && npm run check → exit 0
  • CI: "Fern docs (check)" green on this PR
  • CI: "Preview Fern Docs: Comment" posts a :herb: preview link on this PR (this is the real-world validation that the workflow change works)
  • After merge: confirm next PR touching fern/ also gets a preview comment and a green check

🤖 Generated with Claude Code

Pinning fern-api in package.json drifts: fern ships several releases per
day, and 4.80.3 was treating a transient FDR 403 as fatal, breaking the
"Fern docs (check)" and preview-comment jobs on every PR. Drop the
devDependency and lockfile; have the npm scripts and the preview job
shell out to "npx -y fern-api@latest" so CI and local dev always run a
current CLI without manual bumps.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Signed-off-by: Lawrence Lane <[email protected]>
@lbliii
lbliii requested a review from a team as a code owner April 30, 2026 13:53
lbliii and others added 3 commits April 30, 2026 10:03
Co-Authored-By: Claude Opus 4.7 <[email protected]>
Signed-off-by: Lawrence Lane <[email protected]>
`fern check` exits 1 with zero output (no stdout, no stderr) whenever
docs.yml has a `check.rules` entry for `broken-links` or
`missing-redirects` at any level (warn or error). Reproduced across
fern-api 4.99.0 → 5.1.0.

Removing the block makes fern check pass; broken links and missing
redirects are still caught at publish time by `fern generate --docs`.
A NOTE comment documents what to do when fern fixes the upstream bug.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Signed-off-by: Lawrence Lane <[email protected]>
Restore `missing-redirects: error` in docs.yml and pass FERN_TOKEN to the
check workflow. Per fern's site-level-settings docs, missing-redirects is
supposed to be skipped when unauthenticated; we're seeing it silently
exit 1 instead. This commit tests whether passing the token (which the
publish + preview-comment workflows already use) lets the rule run.

If CI passes, the token is the proper fix. If it still fails, the bug
runs deeper than auth.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Signed-off-by: Lawrence Lane <[email protected]>
@lbliii
lbliii requested a review from chtruong814 May 1, 2026 15:56
@lbliii
lbliii merged commit 60f35db into main May 1, 2026
7 of 8 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.

2 participants