Skip to content

chore: attempt to fix fern docs comment failures - #977

Merged
mckornfield merged 3 commits into
mainfrom
fern-docs-comment-fix-attempt/mck
Jul 30, 2026
Merged

chore: attempt to fix fern docs comment failures#977
mckornfield merged 3 commits into
mainfrom
fern-docs-comment-fix-attempt/mck

Conversation

@mckornfield

@mckornfield mckornfield commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved documentation preview generation with more reliable identifiers, safer branch handling, and stronger validation of preview metadata.
    • Enhanced failure handling and more resilient extraction of the published documentation URL to reduce avoidable pipeline errors.
  • New Features
    • Added manual triggering for the documentation preview workflow with configurable inputs (source run ID, PR number, and head reference).
  • Documentation
    • Updated generated docs.yml release entries to omit the availability: "stable" field, keeping only display-name, path, and slug.

Signed-off-by: Matt Kornfield <mkornfield@nvidia.com>
@mckornfield
mckornfield requested a review from a team as a code owner July 29, 2026 21:26
@github-actions github-actions Bot added the chore label Jul 29, 2026
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The workflow supports manual Fern previews, validates trusted metadata, computes deterministic preview identifiers, and handles generation failures and URL extraction explicitly. Release entries now omit availability while retaining display-name, path, and slug.

Changes

Fern documentation updates

Layer / File(s) Summary
Validate metadata and generate preview
.github/workflows/fern-docs-preview-comment.yaml
Adds manual inputs, validates workflow and artifact PR metadata, sanitizes branch data, computes preview_id, prepares docs, and handles Fern generation and URL extraction explicitly.
Materialize release version entries
docs/fern/scripts/materialize-release-versions.mjs
Generated release entries now contain display-name, path, and slug without availability: "stable".

Sequence Diagram(s)

sequenceDiagram
  participant Workflow as GitHub Actions workflow
  participant Artifact as Preview metadata artifact
  participant Fern as fern-api generate
  Workflow->>Artifact: Read preview-metadata/pr_number
  Workflow->>Workflow: Validate metadata and compute preview_id
  Workflow->>Fern: Generate preview with preview_id
  Fern-->>Workflow: Return status and published docs URL
Loading

Possibly related PRs

Suggested labels: chore

Suggested reviewers: crookedstorm, mquong-ca, svvarom

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: a chore to fix Fern docs comment failures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fern-docs-comment-fix-attempt/mck

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/fern-docs-preview-comment.yaml:
- Line 95: Update the fern-api invocation in the workflow’s preview generation
command to use an approved exact package version instead of the floating latest
tag. Preserve the existing generate arguments, preview ID, output capture, and
token handling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7871d73c-e766-47f0-a9b5-18a8c44caa08

📥 Commits

Reviewing files that changed from the base of the PR and between 9aaf35d and 25ba8b0.

📒 Files selected for processing (1)
  • .github/workflows/fern-docs-preview-comment.yaml

Comment thread .github/workflows/fern-docs-preview-comment.yaml
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 28185/36015 78.3% 62.6%
Integration Tests 16745/34733 48.2% 20.9%

@mckornfield
mckornfield requested review from a team as code owners July 29, 2026 22:18

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/fern-docs-preview-comment.yaml:
- Around line 20-38: Update the metadata resolution step to branch on the event
type: for workflow_dispatch runs, use the pr_number and head_ref inputs, while
retaining the existing github.event.workflow_run metadata and trusted-run
validation for workflow_run executions. Ensure manual runs no longer pass empty
PR metadata to validation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d5a1d248-0baa-4e71-95df-8ac40530c964

📥 Commits

Reviewing files that changed from the base of the PR and between 25ba8b0 and 9cd9f05.

📒 Files selected for processing (2)
  • .github/workflows/fern-docs-preview-comment.yaml
  • docs/fern/scripts/materialize-release-versions.mjs
💤 Files with no reviewable changes (1)
  • docs/fern/scripts/materialize-release-versions.mjs

Comment thread .github/workflows/fern-docs-preview-comment.yaml Outdated
@mckornfield
mckornfield force-pushed the fern-docs-comment-fix-attempt/mck branch 2 times, most recently from 6bcca1a to a985420 Compare July 29, 2026 22:40

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/fern-docs-preview-comment.yaml (1)

100-109: 🔒 Security & Privacy | 🔴 Critical | 🏗️ Heavy lift

Do not execute PR-controlled artifact code with FERN_TOKEN.

docs/fern comes from the untrusted PR artifact, but node scripts/filter-public-openapi.mjs runs with FERN_TOKEN in its environment. A malicious PR can replace this script and exfiltrate the token. Run this filtering in the unprivileged build job or execute only code from a trusted checkout, with secrets withheld from artifact-executing steps.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/fern-docs-preview-comment.yaml around lines 100 - 109,
Update the “Generate preview URL” step so the PR-controlled `node
scripts/filter-public-openapi.mjs` never runs with `FERN_TOKEN` available. Move
filtering to the unprivileged build job or run it from a trusted checkout, and
keep `FERN_TOKEN` restricted to the trusted Fern generation command.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.github/workflows/fern-docs-preview-comment.yaml:
- Around line 100-109: Update the “Generate preview URL” step so the
PR-controlled `node scripts/filter-public-openapi.mjs` never runs with
`FERN_TOKEN` available. Move filtering to the unprivileged build job or run it
from a trusted checkout, and keep `FERN_TOKEN` restricted to the trusted Fern
generation command.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a0ffcbda-cbd7-43c7-b6b5-3c7ac7dbfe91

📥 Commits

Reviewing files that changed from the base of the PR and between 9cd9f05 and 6bcca1a.

📒 Files selected for processing (2)
  • .github/workflows/fern-docs-preview-comment.yaml
  • docs/fern/scripts/materialize-release-versions.mjs
💤 Files with no reviewable changes (1)
  • docs/fern/scripts/materialize-release-versions.mjs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/fern-docs-preview-comment.yaml:
- Around line 20-25: Harden the workflow around source_run_id and the
artifact-processing step: validate that the referenced run is the successful
Preview Fern Docs build for the expected PR, head branch, and commit SHA, and
require matching artifact metadata rather than treating it as optional. Ensure
downloaded docs/ content cannot execute with FERN_TOKEN by moving processing to
an unprivileged job or running only scripts checked out from a trusted revision,
including the commands around lines 107-109.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 86180b9e-ce28-4c7c-bfb8-dfb63790e638

📥 Commits

Reviewing files that changed from the base of the PR and between 6bcca1a and a985420.

📒 Files selected for processing (2)
  • .github/workflows/fern-docs-preview-comment.yaml
  • docs/fern/scripts/materialize-release-versions.mjs
💤 Files with no reviewable changes (1)
  • docs/fern/scripts/materialize-release-versions.mjs

Comment thread .github/workflows/fern-docs-preview-comment.yaml
Signed-off-by: Matt Kornfield <mkornfield@nvidia.com>
@mckornfield
mckornfield force-pushed the fern-docs-comment-fix-attempt/mck branch from a985420 to c91c2dd Compare July 29, 2026 22:51

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
.github/workflows/fern-docs-preview-comment.yaml (1)

22-33: 🔒 Security & Privacy | 🔴 Critical

Require provenance before downloading and executing the artifact.

The manual inputs feed directly into the artifact run-id; only PR-number syntax is checked, and artifact metadata remains optional. Line 107 then runs an npm package script from that downloaded tree while FERN_TOKEN is available. A caller-selected malicious run can therefore exfiltrate the token. (docs.github.com)

Validate the source run’s workflow, success state, PR/head/SHA, and require matching metadata. Process downloaded content without secrets or use scripts from a trusted checkout.

Also applies to: 48-48, 55-56, 65-75, 107-107

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/fern-docs-preview-comment.yaml around lines 22 - 33,
Harden the fern-docs preview workflow before using the artifact and running its
npm script: validate that the supplied source_run_id belongs to the expected
workflow, completed successfully, and matches the PR number, head_ref, and
commit SHA, while requiring and verifying matching artifact metadata. Ensure
downloaded artifact content is processed without FERN_TOKEN, or execute scripts
only from a trusted checkout rather than the downloaded tree.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/fern-docs-preview-comment.yaml:
- Line 107: Update the prepare step in the workflow to run npm from its existing
./docs/fern working directory without the redundant --prefix argument. Replace
the prefixed command with the local npm run prepare invocation.

---

Duplicate comments:
In @.github/workflows/fern-docs-preview-comment.yaml:
- Around line 22-33: Harden the fern-docs preview workflow before using the
artifact and running its npm script: validate that the supplied source_run_id
belongs to the expected workflow, completed successfully, and matches the PR
number, head_ref, and commit SHA, while requiring and verifying matching
artifact metadata. Ensure downloaded artifact content is processed without
FERN_TOKEN, or execute scripts only from a trusted checkout rather than the
downloaded tree.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: eda6d50d-443e-42cb-94d3-10dde80fa752

📥 Commits

Reviewing files that changed from the base of the PR and between a985420 and c91c2dd.

📒 Files selected for processing (2)
  • .github/workflows/fern-docs-preview-comment.yaml
  • docs/fern/scripts/materialize-release-versions.mjs
💤 Files with no reviewable changes (1)
  • docs/fern/scripts/materialize-release-versions.mjs

Comment thread .github/workflows/fern-docs-preview-comment.yaml Outdated
Signed-off-by: Matt Kornfield <mkornfield@nvidia.com>
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Comment thread docs/fern/scripts/materialize-release-versions.mjs
@svvarom
svvarom self-requested a review July 29, 2026 23:26

@svvarom svvarom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@mckornfield
mckornfield added this pull request to the merge queue Jul 30, 2026
Merged via the queue into main with commit 434c0db Jul 30, 2026
58 of 60 checks passed
@mckornfield
mckornfield deleted the fern-docs-comment-fix-attempt/mck branch July 30, 2026 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants