Skip to content

[codex] Fix Fern preview metadata upload#2141

Merged
lbliii merged 2 commits into
NVIDIA-NeMo:mainfrom
lbliii:codex/fix-fern-preview-metadata
Jul 2, 2026
Merged

[codex] Fix Fern preview metadata upload#2141
lbliii merged 2 commits into
NVIDIA-NeMo:mainfrom
lbliii:codex/fix-fern-preview-metadata

Conversation

@lbliii

@lbliii lbliii commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • include hidden files when uploading the Fern preview artifact
  • preserve the existing .preview-metadata/ producer/consumer contract

Root cause

actions/upload-artifact v4 excludes hidden files by default. The Fern preview build stores the pull request number, head ref, and changed-file list under .preview-metadata/, so the companion workflow_run downloaded the Fern sources without that metadata.

As a result, HEAD_REF and PR_NUMBER were empty: Fern published to the shared preview-default identifier and the PR-comment request failed with HTTP 404. This affected draft and ready-for-review pull requests alike.

Example failed publisher run: https://github.com/NVIDIA-NeMo/Curator/actions/runs/28404447988

Validation

  • workflow YAML parses successfully
  • git diff --check passes
  • the pinned actions/upload-artifact@v4.6.2 step receives its supported include-hidden-files input

The PR's own Preview Fern Docs: Build and subsequent Preview Fern Docs: Comment runs provide the end-to-end validation.

Signed-off-by: Lawrence Lane <llane@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@lbliii lbliii self-assigned this Jun 30, 2026
@lbliii lbliii marked this pull request as ready for review June 30, 2026 13:45
@lbliii lbliii requested a review from a team as a code owner June 30, 2026 13:45
@github-actions

Copy link
Copy Markdown
Contributor

@greptile-apps

greptile-apps Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a one-line bug in the Fern docs preview CI workflow where .preview-metadata/ was silently dropped during artifact upload because actions/upload-artifact v4 excludes hidden files (dot-prefixed paths) by default.

  • Adds include-hidden-files: true to the Upload fern sources and metadata step so the .preview-metadata/ directory — containing pr_number, head_ref, and changed_mdx_files — is correctly bundled into the fern-preview artifact and available to the downstream workflow_run publisher job.

Confidence Score: 5/5

Safe to merge — the change is a single-line targeted fix that restores the intended artifact upload behavior.

The fix correctly addresses the root cause: actions/upload-artifact v4 silently omits dot-prefixed paths unless include-hidden-files: true is set, and .preview-metadata/ is exactly such a path. The action is pinned to a SHA, the retention-days is unchanged, and no secrets or permissions are touched. The companion workflow_run consumer gains the metadata it always expected.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/fern-docs-preview-build.yml Adds include-hidden-files: true to upload-artifact step so .preview-metadata/ is included in the artifact; fix is correct and minimal.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant PR as Pull Request (PR branch)
    participant Build as Preview Fern Docs: Build (pull_request trigger)
    participant Artifact as actions/upload-artifact v4 (fern-preview)
    participant Comment as Preview Fern Docs: Comment (workflow_run trigger)

    PR->>Build: push / PR open/sync
    Build->>Build: Checkout PR branch
    Build->>Build: Save PR metadata to .preview-metadata/
    Note over Build: .preview-metadata/ is a hidden dot-prefixed directory
    Build->>Artifact: Upload fern/ + .preview-metadata/ with include-hidden-files: true
    Artifact-->>Comment: Download fern-preview artifact (metadata now present)
    Comment->>Comment: "Read PR_NUMBER & HEAD_REF from .preview-metadata/"
    Comment->>Comment: Build Fern preview with DOCS_FERN_TOKEN
    Comment->>PR: Post preview URL as PR comment
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant PR as Pull Request (PR branch)
    participant Build as Preview Fern Docs: Build (pull_request trigger)
    participant Artifact as actions/upload-artifact v4 (fern-preview)
    participant Comment as Preview Fern Docs: Comment (workflow_run trigger)

    PR->>Build: push / PR open/sync
    Build->>Build: Checkout PR branch
    Build->>Build: Save PR metadata to .preview-metadata/
    Note over Build: .preview-metadata/ is a hidden dot-prefixed directory
    Build->>Artifact: Upload fern/ + .preview-metadata/ with include-hidden-files: true
    Artifact-->>Comment: Download fern-preview artifact (metadata now present)
    Comment->>Comment: "Read PR_NUMBER & HEAD_REF from .preview-metadata/"
    Comment->>Comment: Build Fern preview with DOCS_FERN_TOKEN
    Comment->>PR: Post preview URL as PR comment
Loading

Reviews (2): Last reviewed commit: "Merge branch 'main' into codex/fix-fern-..." | Re-trigger Greptile

lbliii commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 6906c88

@lbliii lbliii enabled auto-merge (squash) July 2, 2026 17:49
@lbliii lbliii merged commit 5ac282b into NVIDIA-NeMo:main Jul 2, 2026
60 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