Skip to content

Commit 08c4c4f

Browse files
committed
docs(fern): migrate documentation to Fern
Signed-off-by: Lawrence Lane <llane@nvidia.com>
1 parent a2a939d commit 08c4c4f

42 files changed

Lines changed: 1041 additions & 1044 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/switchyard-docs/SKILL.md‎

Lines changed: 135 additions & 90 deletions
Large diffs are not rendered by default.

‎.agents/skills/switchyard-testing-ci/SKILL.md‎

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use `cargo test --workspace` before calling a broad Rust MR ready.
2424

2525
| Situation | Command |
2626
|---|---|
27-
| Pick gates from the current diff | `python .agents/skills/switchyard-testing-ci/scripts/select_validation.py --changed` |
27+
| Map the current diff | `git status -sb && git diff --stat && git diff --name-only` |
2828
| Pre-PR hermetic gate (default) | `uv run ruff check . && uv run mypy switchyard && env -u OPENROUTER_API_KEY -u NVIDIA_API_KEY -u OPENAI_API_KEY -u ANTHROPIC_API_KEY uv run pytest tests/ -v -m "not integration"` |
2929
| Mirror CI pytest with no live creds | `env -u OPENROUTER_API_KEY -u NVIDIA_API_KEY -u OPENAI_API_KEY -u ANTHROPIC_API_KEY uv run pytest tests/ -v -m "not integration"` |
3030
| Rust component crate change | `cargo fmt --all --check && cargo clippy --workspace --all-targets -- -D warnings && cargo test -p switchyard-components` |
@@ -34,26 +34,18 @@ use `cargo test --workspace` before calling a broad Rust MR ready.
3434
| Live e2e (only on explicit user request) | `NVIDIA_API_KEY=… uv run pytest tests/e2e/ -v -m integration -o addopts= --maxfail=10` |
3535
| Skill/docs change only | YAML frontmatter check + `git diff --check` (see [Skill/docs-only gate](#skilldocs-only-gate)) |
3636

37-
## Dynamic Selection First
37+
## Diff-Based Selection First
3838

39-
From the repo root, inspect the diff and let the selector propose focused gates:
39+
From the repo root, inspect the diff and map each changed area to the focused gates below:
4040

4141
```bash
4242
cd "$(git rev-parse --show-toplevel)"
4343
git status -sb
4444
git diff --stat
45-
python .agents/skills/switchyard-testing-ci/scripts/select_validation.py --changed
4645
```
4746

48-
For a not-yet-edited area, pass likely owners explicitly:
49-
50-
```bash
51-
python .agents/skills/switchyard-testing-ci/scripts/select_validation.py \
52-
--path switchyard/lib/translation/request_engine.py \
53-
--path tests/test_request_translation_engine.py
54-
```
55-
56-
Use the output as the starting plan, then add any tests revealed by code search or by the failure.
47+
Use the current diff as the starting plan, then add any tests revealed by code search or by the
48+
failure map in this skill.
5749

5850
## CI Gates and Local Equivalence
5951

@@ -303,7 +295,6 @@ uv run pytest tests/test_cli_stale_names.py tests/test_no_stale_module_paths.py
303295
| Running `uv run pytest tests/ -v` with `OPENROUTER_API_KEY`/`NVIDIA_API_KEY`/`OPENAI_API_KEY`/`ANTHROPIC_API_KEY` set in your shell | Tests that mock providers can accidentally hit live endpoints. Default to `-m "not integration"`, or strip credentials with `env -u`. |
304296
| Treating mypy as optional because CI marks it `continue-on-error` | Mypy still catches real bugs in `switchyard/` typed code. Run it for any change to profiles, route bundles, backends, request/response models, or translation. |
305297
| Skipping the slim-install smoke gate after a dependency or top-level import change | This is the *actual* hard CI gate that catches `torch`/`transformers`/`routellm` accidentally landing in the default install. |
306-
| Claiming validation from `scripts/select_validation.py` without rerunning it after committing changes | The script diffs against `HEAD` plus untracked files; if your changes are already committed, `--changed` returns "no diff". Pass `--path` explicitly, or diff against the branch base. |
307298
| Adding `# noqa` or per-line ignores to make ruff green | Ruff is a hard CI gate. Fix the code or, if the rule is wrong here, lift the ignore to the file or project level with a one-line justification. |
308299
| Editing a generated artifact (e.g., `docs/.venv-docs/...`) because ruff complained about it | Delete the artifact instead. CI does not have it; you should not either. |
309300

‎.github/workflows/docs.yml‎

Lines changed: 0 additions & 100 deletions
This file was deleted.

‎.github/workflows/fern-docs-ci.yml‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# Validates Fern docs configuration on pull requests.
17+
18+
name: Fern docs (check)
19+
20+
on:
21+
pull_request:
22+
paths:
23+
- "docs/**"
24+
- ".github/workflows/fern-docs-*.yml"
25+
- ".github/workflows/publish-fern-docs.yml"
26+
push:
27+
branches: [main]
28+
paths:
29+
- "docs/**"
30+
- ".github/workflows/fern-docs-*.yml"
31+
- ".github/workflows/publish-fern-docs.yml"
32+
33+
permissions:
34+
contents: read
35+
36+
jobs:
37+
check:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v6
42+
43+
- name: Setup Node.js
44+
uses: actions/setup-node@v6
45+
with:
46+
node-version: "20"
47+
48+
- name: Install Fern CLI
49+
run: npm install -g fern-api@$(jq -r .version docs/fern/fern.config.json)
50+
51+
- name: Validate Fern configuration
52+
working-directory: ./docs/fern
53+
run: fern check
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# Workflow 1 of 2 for Fern doc previews.
17+
#
18+
# Collects the docs sources and PR metadata from the possibly untrusted PR
19+
# branch. No secrets are used here, so this is safe to run on fork PRs.
20+
# The companion workflow builds the preview and posts the PR comment.
21+
22+
name: "Preview Fern Docs: Build"
23+
24+
on:
25+
pull_request:
26+
paths:
27+
- "docs/**"
28+
- ".github/workflows/fern-docs-preview-build.yml"
29+
30+
permissions:
31+
contents: read
32+
33+
jobs:
34+
collect:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout PR
38+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
39+
with:
40+
fetch-depth: 0
41+
42+
- name: Save PR metadata
43+
env:
44+
PR_NUMBER: ${{ github.event.pull_request.number }}
45+
HEAD_REF: ${{ github.head_ref }}
46+
BASE_REF: ${{ github.base_ref }}
47+
run: |
48+
mkdir -p .preview-metadata
49+
echo "$PR_NUMBER" > .preview-metadata/pr_number
50+
echo "$HEAD_REF" > .preview-metadata/head_ref
51+
git diff --name-only "origin/${BASE_REF}...HEAD" -- '*.mdx' > .preview-metadata/changed_mdx_files 2>/dev/null || true
52+
53+
# The nightly navigation reaches from docs/fern/ into docs/**/*.mdx,
54+
# so the artifact must preserve the complete docs tree.
55+
- name: Upload docs sources and metadata
56+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
57+
with:
58+
name: fern-preview
59+
path: |
60+
docs/
61+
.preview-metadata/
62+
include-hidden-files: true
63+
retention-days: 1

0 commit comments

Comments
 (0)