Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3630d5a
draft
anakin87 Feb 11, 2026
2dfdeef
Merge branch 'main' into check-docusaurus-build
anakin87 Feb 11, 2026
c0d9981
trigger run
anakin87 Feb 11, 2026
aa2f391
evolve
anakin87 Feb 11, 2026
cca5390
improvs
anakin87 Feb 11, 2026
8ce0ff4
fix
anakin87 Feb 11, 2026
a945701
clean up
anakin87 Feb 11, 2026
69e33c8
save file
anakin87 Feb 11, 2026
a8901da
build step + trigger
anakin87 Feb 11, 2026
d1921d3
retry
anakin87 Feb 11, 2026
4d7c492
use python
anakin87 Feb 11, 2026
d136e51
improve
anakin87 Feb 11, 2026
9d2129d
script + simplify
anakin87 Feb 11, 2026
ff901e7
fix
anakin87 Feb 11, 2026
514dfb9
simulate new integration
anakin87 Feb 11, 2026
d282123
fix
anakin87 Feb 11, 2026
749d11a
refix
anakin87 Feb 11, 2026
773bc15
revert temp changes
anakin87 Feb 11, 2026
4fbbf2f
skip worktree removal
anakin87 Feb 11, 2026
02c8ac6
lighter setup + trigger
anakin87 Feb 11, 2026
708a09f
legit change
anakin87 Feb 11, 2026
1000947
rm temp change
anakin87 Feb 11, 2026
50ab9fa
try simplifying more
anakin87 Feb 11, 2026
7a52cfb
fail
anakin87 Feb 11, 2026
0b1a6c4
verbose
anakin87 Feb 11, 2026
ac82bd4
cat
anakin87 Feb 11, 2026
295150a
rm change
anakin87 Feb 11, 2026
cc71fbd
helpful err msg
anakin87 Feb 11, 2026
65d50da
revert Qdrant change
anakin87 Feb 11, 2026
1e565d1
small refinement
anakin87 Feb 11, 2026
2603db8
simplifications
anakin87 Feb 12, 2026
86509bb
triggers
anakin87 Feb 12, 2026
15e40d8
retry
anakin87 Feb 12, 2026
d887b82
fix workflow
anakin87 Feb 12, 2026
d0fcc79
rm triggers
anakin87 Feb 12, 2026
10a4da5
unify and test
anakin87 Feb 12, 2026
8609e44
use righ base_sha
anakin87 Feb 12, 2026
3eea31a
rm triggers
anakin87 Feb 12, 2026
3fd9c54
try new integr
anakin87 Feb 12, 2026
082881b
rm new int
anakin87 Feb 12, 2026
322abda
Merge branch 'main' into check-docusaurus-build
anakin87 Feb 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/utils/docstrings_checksum.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ def docstrings_checksum(python_files: Iterator[Path]):

parser = argparse.ArgumentParser()
parser.add_argument("--root", help="Project root folder", required=True, type=Path)
parser.add_argument("--integration", help="Integration folder relative path", required=False, type=str)
args = parser.parse_args()

# Get all Python files
root: Path = args.root.absolute()
python_files = root.glob("integrations/**/*.py")

if args.integration:
python_files = root.glob(f"integrations/{args.integration}/**/*.py")
md5 = docstrings_checksum(python_files)
print(md5)
1 change: 0 additions & 1 deletion .github/utils/pyproject_to_requirements.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import argparse
import sys
from pathlib import Path
import toml

Expand Down
116 changes: 116 additions & 0 deletions .github/workflows/CI_check_api_ref.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Core / Check API reference changes

on:
pull_request:
paths:
- "integrations/**/*.py"
- "integrations/**/config_docusaurus.yml"

jobs:
test-api-reference-build:
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Detect integrations with API reference changes
id: changed
shell: python
run: |
import json
Copy link
Member Author

Choose a reason for hiding this comment

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

  1. This is long but tightly coupled with the workflow, so I haven't extracted it to a utility script
  2. While bash would have been more natural for it (invokes Git, ...), I chose to use Python because we are all more familiar with it, so this seems to be more maintainable in the long run

import os
import subprocess
import sys
from pathlib import Path

sys.path.insert(0, ".github/utils")
from docstrings_checksum import docstrings_checksum

def git(*args):
result = subprocess.run(["git", *args], capture_output=True, text=True)
return result.stdout.strip(), result.returncode

runner_temp = os.environ["RUNNER_TEMP"]
base_sha, _ = git("rev-parse", "HEAD^1")

# Get all changed files
diff_output, _ = git(
"diff", "--name-only", f"{base_sha}...HEAD", "--", "integrations"
)
changed_files = set(diff_output.splitlines())

# Extract integration names
candidates = sorted({
Path(p).parts[1]
for p in changed_files
if p.startswith("integrations/") and len(Path(p).parts) > 1
})

# Create base worktree for docstring comparison
base_worktree = os.path.join(runner_temp, "base")
_, return_code = git("worktree", "add", base_worktree, base_sha)
has_worktree = return_code == 0

changed_integrations = []

for integration in candidates:
# If pydoc config changed, always include
if f"integrations/{integration}/pydoc/config_docusaurus.yml" in changed_files:
changed_integrations.append(integration)
continue

# Otherwise, check if docstrings changed
pr_docstrings_checksum = docstrings_checksum(Path(".").glob(f"integrations/{integration}/**/*.py"))
base_docstrings_checksum = ""
if has_worktree:
base_docstrings_checksum = docstrings_checksum(Path(base_worktree).glob(f"integrations/{integration}/**/*.py"))

if base_docstrings_checksum != pr_docstrings_checksum:
changed_integrations.append(integration)

print(f"Integrations with API reference changes: {json.dumps(changed_integrations)}")

with open(os.environ["GITHUB_OUTPUT"], "a") as f:
f.write(f"integrations={json.dumps(changed_integrations)}\n")

- name: Install Hatch
if: steps.changed.outputs.integrations != '[]'
run: pip install --upgrade hatch

- name: Generate API references
if: steps.changed.outputs.integrations != '[]'
env:
INTEGRATIONS: ${{ steps.changed.outputs.integrations }}
run: |
mkdir -p website
for integration in $(echo "$INTEGRATIONS" | jq -r '.[]'); do
echo ""
echo "--- Generating API reference for $integration ---"
cd "integrations/$integration"
hatch run docs
# Move the generated file to a 'website' folder for testing
mv "$integration.md" ../../website/
cd ../..
done

- name: Set up Node.js
if: steps.changed.outputs.integrations != '[]'
uses: actions/setup-node@v6
with:
node-version: "22"

- name: Run Docusaurus md/mdx checker
if: steps.changed.outputs.integrations != '[]'
working-directory: website
run: |
npx docusaurus-mdx-checker -v || {
echo ""
echo "For common MDX problems, see https://docusaurus.io/blog/preparing-your-site-for-docusaurus-v3#common-mdx-problems"
exit 1
}