Skip to content

docs: improve reference navigation and add missing API docs #232

docs: improve reference navigation and add missing API docs

docs: improve reference navigation and add missing API docs #232

Workflow file for this run

---
name: PR Documentation Preview
# Build documentation previews for pull requests
# Uploads as artifacts for manual review
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'docs/**'
- 'src/**'
- '*.md'
- 'pyproject.toml'
- '.github/workflows/docs-*.yml'
- '.agent-os/product/**'
- '.agent-os/standards/**'
- 'examples/**'
jobs:
validate-api:
name: Validate API Surface
runs-on: ubuntu-latest
steps:
- name: Checkout PR
uses: actions/checkout@v6
# MANDATORY: AI Assistant Validation Protocol
- name: πŸ” Validate Current API Surface
run: |
echo "AI Assistant Validation Protocol: Checking current API exports..."
# Verify core files exist
if [ ! -f "src/honeyhive/__init__.py" ]; then
echo "❌ src/honeyhive/__init__.py not found"
exit 1
fi
# Check exports in __all__ (correct way for this codebase)
if ! grep -q '"HoneyHive"' src/honeyhive/__init__.py; then
echo "❌ HoneyHive not found in __all__ exports"
exit 1
fi
if ! grep -q '"HoneyHiveTracer"' src/honeyhive/__init__.py; then
echo "❌ HoneyHiveTracer not found in __all__ exports"
exit 1
fi
echo "βœ… API validation passed"
build-preview:
name: Build Documentation Preview
runs-on: ubuntu-latest
needs: validate-api
permissions:
pull-requests: write
contents: read
steps:
- name: Checkout PR
uses: actions/checkout@v6
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: 'pip'
- name: Create virtual environment (python-sdk)
run: |
python -m venv python-sdk
source python-sdk/bin/activate
echo "python-sdk/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
source python-sdk/bin/activate
python -m pip install --upgrade pip
# Install package
pip install -e .
# Install documentation dependencies
pip install sphinx>=7.0.0 sphinx-rtd-theme>=1.3.0
pip install sphinx-autodoc-typehints myst-parser sphinx-copybutton sphinx-design
pip install sphinxcontrib-mermaid sphinx-tabs
- name: Test imports
run: |
source python-sdk/bin/activate
# Verify the API we're documenting actually works
python -c "
from honeyhive import HoneyHive, HoneyHiveTracer
print('βœ… Import test passed')
"
- name: Build documentation
run: |
source python-sdk/bin/activate
cd docs
# Clean and build
make clean
make html
# Prepare for web deployment
touch _build/html/.nojekyll
# Validate output
if [ ! -f "_build/html/index.html" ]; then
echo "❌ Documentation build failed"
exit 1
fi
echo "βœ… Documentation preview built successfully"
- name: Upload documentation artifact
uses: actions/upload-artifact@v4
with:
name: docs-preview-pr-${{ github.event.pull_request.number }}
path: docs/_build/html/
retention-days: 7
- name: Comment PR with preview info
uses: actions/github-script@v7
with:
script: |
const prNumber = context.issue.number;
const artifactUrl = `${context.serverUrl}/${context.repo.owner}/` +
`${context.repo.repo}/actions/runs/${context.runId}`;
const body = `## πŸ“š Documentation Preview Built
βœ… **Documentation preview is ready!**
### πŸ“¦ Download Preview
[Download documentation artifact](${artifactUrl})
### πŸ” How to Review
1. Download the artifact from the link above
2. Extract the files
3. Open \`index.html\` in your browser
### βœ… Validation Status
- API validation: βœ… Passed
- Build process: βœ… Successful
- Import tests: βœ… All imports working
---
*Preview generated for PR #${prNumber}*`;
github.rest.issues.createComment({
issue_number: prNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
});