Skip to content

Add shared build scripts and fix Docusaurus build errors#42

Merged
raghotham merged 1 commit intomainfrom
fix/shared-build-scripts-and-patch-docs
Mar 27, 2026
Merged

Add shared build scripts and fix Docusaurus build errors#42
raghotham merged 1 commit intomainfrom
fix/shared-build-scripts-and-patch-docs

Conversation

@raghotham
Copy link
Copy Markdown
Member

@raghotham raghotham commented Mar 27, 2026

Summary

  • patch-docs-source.sh (new): Shared script that patches llama-stack docs source for a clean Docusaurus build. Handles sidebar validation (removes entries for non-existent doc files), suppresses blog truncation warnings, fixes blog include pattern for .mdx, and runs fix-mdx-compat.py.
  • build-latest.sh (new): Local build script for main branch docs, mirrors build-archived-version.sh but for the latest version. Supports --llama-stack-dir and --output-dir flags.
  • build-archived-version.sh (modified): Replaced individual fix-mdx-compat.py call and blog include fix with a single call to patch-docs-source.sh.
  • .github/workflows/build-and-deploy.yml (modified): Added Python setup, added "Patch docs source" step, replaced inline perl raw-loader path fixing with inline-raw-loader.py.

Motivation

The Docusaurus build fails when building from llama-stack's main branch due to upstream issues:

  1. Invalid sidebar entries (advanced_apis/post_training, providers/agents/index, providers/agents/inline_builtin) referenced in sidebars.ts but missing upstream
  2. Blog truncation warnings treated as errors

These are upstream doc structure issues. The fix makes the build pipeline resilient to them via patch-docs-source.sh, which is shared across the workflow and both local build scripts.

The workflow also had build logic (MDX fixing, raw-loader path patching) duplicated from the shell scripts. This PR consolidates that into the shared scripts.

Test plan

  • Validate YAML syntax: python3 -c "import yaml; yaml.safe_load(open('.github/workflows/build-and-deploy.yml'))"
  • Validate shell syntax: bash -n patch-docs-source.sh && bash -n build-latest.sh && bash -n build-archived-version.sh
  • Run build-latest.sh against a fresh llama-stack clone to verify full build succeeds
  • Run workflow via workflow_dispatch to verify CI build succeeds

Fix Docusaurus build errors caused by upstream issues (missing sidebar
entries, blog truncation warnings) and reduce duplication between the
workflow and shell scripts.

- Create patch-docs-source.sh: shared script that validates sidebar
  entries, suppresses blog truncation warnings, fixes blog include
  pattern, and runs fix-mdx-compat.py
- Create build-latest.sh: local build script for main branch docs
- Update build-archived-version.sh to use patch-docs-source.sh
- Update workflow to call patch-docs-source.sh and inline-raw-loader.py
  instead of inline perl for versioned docs
@meta-cla meta-cla bot added the cla signed label Mar 27, 2026
@raghotham raghotham merged commit 35108f2 into main Mar 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant