Skip to content

docs: publish devnote figure component#721

Merged
johnnygreco merged 1 commit into
mainfrom
johnny/fix/fern-devnote-figure-component
Jun 1, 2026
Merged

docs: publish devnote figure component#721
johnnygreco merged 1 commit into
mainfrom
johnny/fix/fern-devnote-figure-component

Conversation

@johnnygreco

Copy link
Copy Markdown
Contributor

📋 Summary

This PR fixes the Fern Dev Notes publish path so MDX pages that import the shared Figure component can render after being patched into the docs-website branch. It also makes the Dev Notes publish workflow rerun when the support copier or figure component changes, so this repair can publish without waiting for an unrelated docs edit.

🔗 Related Issue

N/A

🔄 Changes

🧪 Testing

  • make test passes (not run; focused docs validation below)
  • uv run --group dev pytest packages/data-designer/tests/docs/test_fern_published_branch.py -q
  • uv run ruff format --check fern/scripts/fern-published-branch.py packages/data-designer/tests/docs/test_fern_published_branch.py
  • uv run ruff check fern/scripts/fern-published-branch.py packages/data-designer/tests/docs/test_fern_published_branch.py
  • npx -y fern-api@5.41.1 check
  • Unit tests added/updated
  • E2E tests added/updated (N/A — docs publish workflow/support-file fix)

✅ Checklist

  • Follows commit message conventions
  • Commits are signed off (DCO)
  • Architecture docs updated (N/A — no architecture docs changed)

Signed-off-by: Johnny Greco <jogreco@nvidia.com>
@johnnygreco johnnygreco requested a review from a team as a code owner June 1, 2026 17:47
@greptile-apps

greptile-apps Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes MDX pages that import Figure.tsx failing to render after being patched into the docs-website branch, by including the component in the set of support files copied during patch-devnotes. It also tightens the CI trigger so that changes to the publish script, the workflow itself, or Figure.tsx automatically re-run publishing without requiring an unrelated docs edit.

  • fern/scripts/fern-published-branch.py: Adds fern/components/Figure.tsx to FERN_DEVNOTE_SUPPORT_PATHS, which is iterated in patch_devnotes to copy support files into the published branch — exactly parallel to how Authors.tsx, BlogCard.tsx, and the other kit components are handled.
  • publish-fern-devnotes.yml: Adds three path filters (Figure.tsx, the publish script, and the workflow file itself) so any change to these support files triggers a publish run.
  • test_fern_published_branch.py: Seeds Figure.tsx in the test fixture and asserts it lands in the published root, giving a regression guard for the fix.

Confidence Score: 5/5

Safe to merge — all three changes are narrow, targeted, and internally consistent.

The script change is a one-line addition to a list that is already iterated uniformly; the new entry follows the exact same pattern as every existing entry. The workflow path filters are additive and correct. The test covers the new behavior with a proper fixture-and-assert pattern, and the assertion validates the exact file content end-to-end through patch_devnotes.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/publish-fern-devnotes.yml Adds three new path triggers: the workflow file itself, fern/components/Figure.tsx, and fern/scripts/fern-published-branch.py — all logically necessary to ensure publishing reruns when support infrastructure changes.
fern/scripts/fern-published-branch.py Adds fern/components/Figure.tsx to FERN_DEVNOTE_SUPPORT_PATHS so it gets copied via copy_path during patch-devnotes, consistent with how every other component in the list is handled.
packages/data-designer/tests/docs/test_fern_published_branch.py Seeds Figure.tsx in the test source fixture and asserts it is present in the published root after patch_devnotes, correctly covering the regression introduced by the missing component.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Push to main] -->|path filter matches| B[publish-fern-devnotes.yml]
    B --> C[Checkout workflow / source / website]
    C --> D[patch-devnotes]
    D --> E[sync_fern_root_config]
    D --> F[copy FERN_DEVNOTE_SUPPORT_PATHS]
    F --> F1[fern/assets]
    F --> F2[Authors.tsx]
    F --> F3[BlogCard.tsx]
    F --> F4[Figure.tsx new]
    F --> F5[MetricsTable.tsx]
    F --> F6[TrajectoryViewer.tsx]
    F --> F7[fern/components/devnotes]
    D --> G[rewrite devnotes nav block]
    G --> H[Commit & push to docs-website]
    H --> I[npx fern generate --docs]
Loading

Reviews (1): Last reviewed commit: "docs: publish devnote figure component" | Re-trigger Greptile

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

MkDocs preview: https://adeda8cf.dd-docs-preview.pages.dev

Fern preview: https://nvidia-preview-pr-721.docs.buildwithfern.com/nemo/datadesigner

Fern previews include the docs-website version archive with PR changes synced into latest. Notebook tutorials are rendered without execution outputs in previews.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Review: PR #721 — docs: publish devnote figure component

Summary

Small, surgical fix (8 additions, 0 deletions across 3 files) that repairs the Fern Dev Notes publish path so MDX pages importing the shared Figure component can render after being patched into the docs-website branch. The PR also broadens the publish workflow's path filter so future repairs to the support copier or Figure.tsx actually trigger a publish without needing an unrelated docs edit to ride along.

Three concrete changes:

  1. fern/scripts/fern-published-branch.py — adds fern/components/Figure.tsx to FERN_DEVNOTE_SUPPORT_PATHS.
  2. .github/workflows/publish-fern-devnotes.yml — adds three new path-filter entries: the workflow itself, the publish script, and Figure.tsx.
  3. packages/data-designer/tests/docs/test_fern_published_branch.py — adds a regression assertion that Figure.tsx is copied into the published tree.

Findings

Correctness — looks good

  • Figure.tsx follows the same component-injects-its-own-CSS pattern as Authors.tsx (uses <style dangerouslySetInnerHTML={{ __html: FIGURE_CSS }} />). This matches the comment in fern-published-branch.py:41-43 explaining why dev-note kit components don't need a paired stylesheet entry. No companion fern/styles/figure.css is needed in either the support-paths list or the workflow path filter — the change is self-consistent.
  • The FERN_DEVNOTE_SUPPORT_PATHS list stays alphabetically ordered (Authors, BlogCard, Figure, MetricsTable, TrajectoryViewer). Good.
  • The workflow path filter also remains lexically sorted. Mixing .github/... and fern/scripts/... entries in among the fern/components/... and fern/styles/... entries is fine by sort order, though it does fragment the visual grouping a bit — minor, not worth changing.
  • Self-triggering on workflow edits (.github/workflows/publish-fern-devnotes.yml) is the right call here: repairs to this workflow should be able to publish without piggybacking on an unrelated docs change. This is the same convention used in many self-hosted publish workflows.
  • Adding fern/scripts/fern-published-branch.py to the path filter closes the same gap for the publish script. Sensible.

Test coverage — adequate

  • The new assertion (test_fern_published_branch.py:129-131) follows the established pattern for verifying support-path copies, and the corresponding setup line at :66 plants a small fixture file. This matches how other support files are exercised in the same test (the test already covers assets/current-devnote-asset.png).
  • One observation, not a request: only Figure.tsx and assets/... are exercised positively in this single test. Other entries in FERN_DEVNOTE_SUPPORT_PATHS (Authors, BlogCard, MetricsTable, TrajectoryViewer, devnotes) are not individually asserted. That's pre-existing, not introduced here.

Style / conventions — clean

  • Alphabetic ordering preserved in both the Python list and the YAML path filter.
  • Test uses the existing write_text helper rather than rolling its own.
  • The MDX/component change is consistent with the previously merged 8bd231383 docs(devnotes): add Nemotron-Personas dev note and ad6a1e420 docs: re-adopt global theme; components self-inject CSS direction.

Risks — low

  • Blast radius is confined to the docs publish workflow. No production code paths or package internals touched.
  • Backward compat: copying an additional file into the published tree is additive — there's no risk of clobbering an unrelated published artifact under that path (the test already validates published-only-asset.png is removed when not in source, but that's by design and unrelated to this addition).
  • No secrets, no destructive ops, no schema changes.

Nits (non-blocking)

  • The test at line 129 uses the somewhat verbose form (published_root / "fern" / "components" / "Figure.tsx").read_text() == (...). A direct == "export const Figure = () => null;\n" literal would be slightly more readable, but the existing surrounding assertions use the same parenthesized form for symmetry. Leave it.
  • Considered worth verifying once locally that an MDX page importing @/components/Figure resolves through Fern after the patch — the PR description's manual checks (fern-api check, ruff, pytest) cover the structural side, but the rendered-page side is implicitly covered only when the next devnote with <Figure> lands. Acceptable given the targeted nature of the fix.

Verdict

Approve in spirit (no formal approval per CI policy). The PR is minimal, well-scoped, internally consistent, has a regression test that pins the new behavior, and addresses both the immediate symptom (missing component in published tree) and the meta-issue (path filter that wouldn't have re-triggered on the fix itself). Ready to merge once CI is green.

@johnnygreco johnnygreco merged commit b418153 into main Jun 1, 2026
64 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