Skip to content

Commit f58094e

Browse files
authored
Merge branch 'main' into jinja2-set-vars-incorrect
2 parents 136b7e0 + 02b849b commit f58094e

File tree

513 files changed

+174904
-1307
lines changed

Some content is hidden

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

513 files changed

+174904
-1307
lines changed

.github/actionlint.yml

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

.github/utils/deepset_sync.py

Lines changed: 0 additions & 181 deletions
This file was deleted.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Test Python snippets in docs
2+
3+
on:
4+
schedule:
5+
- cron: '17 3 * * *' # daily at 03:17 UTC
6+
workflow_dispatch:
7+
inputs:
8+
haystack_version:
9+
description: 'Haystack version to test against (e.g., 2.16.1, main)'
10+
required: false
11+
default: 'main'
12+
type: string
13+
14+
# TEMPORARILY DISABLED
15+
# push:
16+
# paths:
17+
# - 'docs-website/docs/**'
18+
# - 'docs-website/versioned_docs/**'
19+
# - 'docs-website/scripts/test_python_snippets.py'
20+
# - 'docs-website/scripts/generate_requirements.py'
21+
# - '.github/workflows/docs-website-test-docs-snippets.yml'
22+
23+
jobs:
24+
test-docs-snippets:
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 20
27+
env:
28+
# TODO: We'll properly set these after migration to core project
29+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v5
33+
34+
- name: Setup Python
35+
uses: actions/setup-python@v6
36+
with:
37+
python-version: '3.11'
38+
39+
- name: Install base dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
pip install requests toml
43+
44+
- name: Generate requirements.txt
45+
run: |
46+
# Use input version or default to main
47+
if [ "${{ github.event.inputs.haystack_version }}" != "" ]; then
48+
VERSION="${{ github.event.inputs.haystack_version }}"
49+
else
50+
VERSION="main"
51+
fi
52+
echo "Generating requirements.txt for Haystack version: $VERSION"
53+
python docs-website/scripts/generate_requirements.py --version "$VERSION"
54+
55+
- name: Install dependencies
56+
run: |
57+
if [ -f requirements.txt ]; then
58+
echo "Installing dependencies from requirements.txt"
59+
pip install -r requirements.txt
60+
else
61+
echo "Error: requirements.txt was not generated"
62+
exit 1
63+
fi
64+
65+
- name: Run snippet tests (verbose)
66+
run: |
67+
# TEMPORARY: Testing with single file to make CI green
68+
# TODO: Expand to run all docs: --paths docs versioned_docs
69+
python docs-website/scripts/test_python_snippets.py --paths docs-website/docs/api/haystack-api/agents_api.md
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Vale Lint
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'docs-website/**'
7+
push:
8+
branches: [ main ]
9+
paths:
10+
- 'docs-website/**'
11+
12+
permissions:
13+
contents: read
14+
pull-requests: write
15+
16+
jobs:
17+
vale:
18+
name: Run Vale
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v5
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v6
26+
with:
27+
node-version: '20'
28+
29+
- name: Install mdx2vast
30+
run: npm install -g mdx2vast
31+
32+
- name: Vale
33+
uses: errata-ai/vale-action@v2
34+
with:
35+
files: |
36+
docs-website/docs
37+
docs-website/versioned_docs
38+
reporter: github-pr-review
39+
fail_on_error: false
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
continue-on-error: true

.github/workflows/docusaurus_sync.yml

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ on:
1212

1313
env:
1414
HATCH_VERSION: "1.14.2"
15-
PYTHON_VERSION: "3.9"
16-
DOCS_REPO: "deepset-ai/haystack-docs"
17-
DOCS_REPO_PATH: "reference/haystack-api"
15+
PYTHON_VERSION: "3.11"
1816

1917
jobs:
2018
sync:
@@ -34,41 +32,29 @@ jobs:
3432
- name: Install Hatch
3533
run: pip install hatch==${{ env.HATCH_VERSION }}
3634

37-
- name: Generate API docs for Docusaurus
35+
- name: Generate API reference for Docusaurus
3836
# This command simply runs ./.github/utils/pydoc-markdown.sh with a specific config path
3937
run: hatch run readme:sync "../config_docusaurus/*"
4038

41-
- name: Checkout Docusaurus repo
42-
uses: actions/checkout@v5
43-
with:
44-
repository: ${{ env.DOCS_REPO }}
45-
token: ${{ secrets.HAYSTACK_BOT_TOKEN }}
46-
path: haystack-docs
47-
48-
- name: Sync generated docs to Docusaurus repo
39+
- name: Sync generated API reference to docs folder
4940
run: |
5041
SOURCE_PATH="docs/pydoc/temp"
51-
DEST_PATH="haystack-docs/${{ env.DOCS_REPO_PATH }}"
42+
DEST_PATH="docs-website/reference/haystack-api"
5243
5344
echo "Syncing from $SOURCE_PATH to $DEST_PATH"
5445
mkdir -p $DEST_PATH
5546
# Using rsync to copy files. This will also remove files in dest that are no longer in source.
5647
rsync -av --delete --exclude='.git/' "$SOURCE_PATH/" "$DEST_PATH/"
5748
58-
- name: Commit and push changes
59-
env:
60-
GITHUB_TOKEN: ${{ secrets.HAYSTACK_BOT_TOKEN }}
61-
run: |
62-
git config --global user.name "github-actions[bot]"
63-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
64-
65-
cd haystack-docs
66-
67-
if [[ -n $(git status -s) ]]; then
68-
echo "Syncing docs with Docusaurus..."
69-
git add .
70-
git commit -m "docs: Sync Haystack API reference"
71-
git push
72-
else
73-
echo "No changes to sync with Docusaurus."
74-
fi
49+
- name: Create Pull Request
50+
uses: peter-evans/create-pull-request@v7
51+
with:
52+
token: ${{ secrets.HAYSTACK_BOT_TOKEN }}
53+
commit-message: "Sync Haystack API reference on Docusaurus"
54+
branch: sync-docusaurus-api-reference
55+
base: main
56+
title: "docs: sync Haystack API reference on Docusaurus"
57+
add-paths: |
58+
docs-website/reference/haystack-api
59+
body: |
60+
This PR syncs the Haystack API reference on Docusaurus. Just approve and merge it.

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,15 @@ coverage.xml
6161
*.mo
6262
*.pot
6363

64+
# Docs website (Docusaurus)
65+
docs-website/.docusaurus/
66+
docs-website/build/
67+
docs-website/node_modules/
68+
docs-website/.cache-loader/
69+
docs-website/.eslintcache
70+
docs-website/.netlify/
71+
docs-website/coverage/
72+
6473
# Django stuff:
6574
*.log
6675
local_settings.py
@@ -144,6 +153,7 @@ dmypy.json
144153
haystack/document_store/qa.db
145154
**/mlruns/**
146155
src
156+
!docs-website/src/
147157
models
148158
saved_models
149159
*_build

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.19.0-rc0
1+
2.20.0-rc0

docs-website/.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto
2+
*.md text diff=markdown
3+
*.mdx text diff=markdown

0 commit comments

Comments
 (0)