Skip to content

fix(ci): include docs/ in Fern preview artifact#290

Merged
dmitsh merged 1 commit into
NVIDIA:mainfrom
resker:fix/fern-preview-artifact-include-docs
Apr 24, 2026
Merged

fix(ci): include docs/ in Fern preview artifact#290
dmitsh merged 1 commit into
NVIDIA:mainfrom
resker:fix/fern-preview-artifact-include-docs

Conversation

@resker
Copy link
Copy Markdown
Collaborator

@resker resker commented Apr 23, 2026

Description

The Fern preview Preview Fern Docs: Comment workflow has been failing on every PR — see the Comment workflow runs, all recent runs `conclusion=failure`. That's why PRs against this repo don't get a :herb: Preview your docs: <URL> comment the way docs-related PRs on sibling NVIDIA OSS repos do.

Root cause. The Build workflow uploads only fern/ and preview-metadata/ as the artifact:

```yaml

.github/workflows/fern-docs-preview-build.yml (before)

path: |
fern/
preview-metadata/
```

But fern/docs.yml references `../docs/index.yml`:

```yaml
$ grep docs/ fern/docs.yml
path: ../docs/index.yml
path: ../docs/index.yml
```

So when the Comment workflow downloads the artifact and runs `fern generate --docs --preview`, the relative path doesn't resolve and the generate step exits 1. The Comment workflow intentionally never checks out the PR branch (to isolate secrets from untrusted code), so the missing directory can't be recovered there — it has to come from the artifact.

Fix. Add docs/ to the upload-artifact path list so both directories ride along into the artifact. Secret-isolation boundary is unchanged.

Pattern verified against the NVSentinel Fern pipeline, which uploads both directories and produces working preview comments. Example preview on a recent NVSentinel PR: NVIDIA/NVSentinel#1226 (comment)

Checklist

  • Documentation Impact Evaluation — N/A (CI workflow change only)
  • make qualify — N/A (no Go/chart changes)
  • Every commit has a DCO sign-off

Next preview comment

This PR should be the first one to actually receive a :herb: Preview your docs: comment once the updated Build workflow runs on the pull-request/<n> copy branch.

The Fern preview Comment workflow has been failing on every PR with
`fern generate --docs --preview` returning exit 1. Root cause: the Build
workflow uploads only `fern/` and `preview-metadata/` as the artifact,
but `fern/docs.yml` references `../docs/index.yml`, so when the Comment
workflow downloads the artifact and runs `fern generate --docs`, the
relative path doesn't resolve and the generate step fails.

Adding `docs/` to the upload-artifact path list makes both directories
available to the Comment workflow without changing its secret-isolation
boundary (it still never checks out the PR branch directly).

Verified against the NVSentinel fern pipeline, which uploads both
`fern/` and `docs/` and produces working preview comments on its PRs.

Signed-off-by: Rob Esker <resker@nvidia.com>
@resker resker requested a review from dmitsh as a code owner April 23, 2026 02:35
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 23, 2026

Greptile Summary

This PR fixes the broken Fern doc preview pipeline by adding docs/ to the artifact uploaded by the Build workflow. The companion Comment workflow runs fern generate --docs --preview from ./fern, which dereferences ../docs/index.yml — a path that was previously absent from the artifact, causing every preview run to fail with exit 1. The one-line addition resolves the missing path without altering the secret-isolation boundary between the two workflows.

Confidence Score: 5/5

Safe to merge — single targeted fix with no impact outside the CI preview pipeline.

The change is minimal (one path entry added to upload-artifact), the root cause is clearly diagnosed and matches the fix, and the secret-isolation design of the two-workflow pattern is preserved. No code paths or repo permissions are affected.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/fern-docs-preview-build.yml Adds docs/ to the artifact upload path so the companion Comment workflow can resolve ../docs/index.yml referenced in fern/docs.yml; also updates the header comment accordingly.

Sequence Diagram

sequenceDiagram
    participant Bot as copy-PR-bot
    participant Build as Build Workflow
    participant Artifact as GitHub Artifact Store
    participant Comment as Comment Workflow
    participant Fern as Fern CLI
    participant PR as Pull Request

    Bot->>Build: push to pull-request/<n>
    Build->>Build: checkout PR branch
    Build->>Build: save PR metadata
    Build->>Artifact: upload fern/ + docs/ + preview-metadata/
    Note over Artifact: docs/ now included (this fix)
    Artifact-->>Comment: workflow_run trigger (completed)
    Comment->>Artifact: download fern-preview artifact
    Note over Comment: gets fern/, docs/, preview-metadata/
    Comment->>Fern: fern generate --docs --preview (working-dir: ./fern)
    Note over Fern: resolves ../docs/index.yml successfully
    Fern-->>Comment: preview URL
    Comment->>PR: post/update preview comment
Loading

Reviews (1): Last reviewed commit: "fix(ci): include docs/ in Fern preview a..." | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown

@dmitsh dmitsh merged commit 227c108 into NVIDIA:main Apr 24, 2026
5 checks passed
dmitsh pushed a commit that referenced this pull request Apr 29, 2026
PR #268 removed the `branches: [main]` push filter from
`publish-fern-docs.yml` while keeping the `tags: [docs/v*]` filter. With
GitHub Actions, defining `tags:` without a corresponding `branches:`
restricts push events to tag refs only — branch pushes (including main)
no longer trigger the workflow even when their changed paths match the
`paths:` filter.

Symptom: the live Fern site at
https://topograph.docs.buildwithfern.com/topograph has not been
republished since the manual workflow_dispatch on 2026-04-20T16:51Z.
PRs #284, #289, #290, #291, and #292 all touched docs/ but produced
zero workflow runs. The Reference section restored by #284 (and the
clique-semantics clarifications added by #289) are on main but invisible
on the published site.

Restore `branches: [main]` so push events to main with docs/ or fern/
changes resume triggering publishes. Tag pushes for `docs/v*` and manual
`workflow_dispatch` continue to work unchanged.

To clear the backlog after this PR merges, dispatch the workflow
manually one time:

  gh workflow run publish-fern-docs.yml --repo NVIDIA/topograph --ref main

Signed-off-by: Rob Esker <resker@nvidia.com>
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