Compare commits

...
5 Commits
Author SHA1 Message Date
jcabillot e883a791fb Merge pull request 'fix(indexer): restore module-level embedding/batch constants (cronjobs cassés)' (#59) from fix/indexer-missing-constants into main
Docker Build and Push / integration-test (push) Failing after 5m58s
Main Release / hadolint (push) Successful in 50s
Docker Build and Push / test (push) Successful in 5m1s
Docker Build and Push / build (push) Skipped
Main Release / test (push) Successful in 2m25s
Main Release / integration-test (push) Successful in 2m32s
Main Release / build (push) Successful in 3m56s
Main Release / tag (push) Successful in 47s
Renovate / renovate (push) Failing after 14m44s
Tag Release / hadolint (push) Successful in 19s
Tag Release / test (push) Successful in 3m17s
Tag Release / integration-test (push) Failing after 3m3s
Tag Release / build-push (push) Skipped
Reviewed-on: #59
2026-10-17 17:11:51 -04:00
Sagent 3b575bbf83 fix(indexer): restore module-level embedding/batch constants
PR Checks / hadolint (pull_request) Successful in 12s
Docker Build and Push / test (pull_request) Successful in 2m17s
Docker Build and Push / integration-test (pull_request) Successful in 2m38s
PR Checks / pytest (pull_request) Successful in 2m19s
Docker Build and Push / build (pull_request) Successful in 2m39s
PR Checks / build-test (pull_request) Successful in 3m5s
The "make indexer importable without env" refactor (e32806a, merged via PR
#52 on 2026-10-09) removed EMBEDDING_MODEL_NAME, BATCH_SIZE and
EMBEDDING_BATCH_SIZE from the module scope while main() kept referencing
them, so every indexer run died before reaching Qdrant:

    File "/app/src/indexer.py", line 264, in main
        print(f"Loading embedding model: {EMBEDDING_MODEL_NAME}...")
    NameError: name 'EMBEDDING_MODEL_NAME' is not defined

CI never caught it because no test executes main(). Both *-indexer cronjobs
have been failing (BackoffLimitExceeded) since 2026-10-16, i.e. the first
run after the image pin moved to v0.0.22-latest.

- restore the three constants with their pre-refactor defaults
- cover them in tests/test_indexer.py and cross-check that the indexer
  embeds with the same model as server.py (vectors must stay comparable)
- add a ruff F821 gate to the unit job so undefined names fail CI

Fixes mcp-maildir-cabilloteu-indexer and mcp-maildir-gmail-indexer.
2026-10-17 21:04:34 +00:00
jcabillot 4d9bd4c470 Merge pull request 'chore(deps): update dependency python to 3.14' (#54) from renovate/python-3.x into main
Main Release / test (push) Successful in 3m26s
Docker Build and Push / integration-test (push) Successful in 3m47s
Docker Build and Push / test (push) Successful in 3m29s
Main Release / hadolint (push) Successful in 38s
Main Release / integration-test (push) Successful in 3m37s
Renovate / renovate (push) Successful in 1m29s
Main Release / build (push) Successful in 46s
Docker Build and Push / build (push) Successful in 4m11s
Main Release / tag (push) Successful in 42s
Tag Release / test (push) Successful in 2m54s
Tag Release / integration-test (push) Successful in 3m9s
Tag Release / build-push (push) Successful in 3m43s
Tag Release / hadolint (push) Failing after 14m10s
Reviewed-on: #54
2026-10-12 15:56:35 -04:00
renovate cc74f384bf chore(deps): update dependency python to 3.14
renovate/stability-days Updates have met minimum release age requirement
PR Checks / hadolint (pull_request) Successful in 18s
Docker Build and Push / test (pull_request) Successful in 2m7s
PR Checks / pytest (pull_request) Successful in 2m8s
Docker Build and Push / integration-test (pull_request) Successful in 2m19s
PR Checks / build-test (pull_request) Successful in 2m23s
Docker Build and Push / build (pull_request) Successful in 1m49s
2026-10-09 21:10:08 +00:00
jcabillot 52642f9d99 Merge pull request 'chore(deps): update dependency fastmcp to v4' (#48) from renovate/fastmcp-4.x into main
Main Release / hadolint (push) Successful in 20s
Docker Build and Push / test (push) Successful in 2m25s
Renovate / renovate (push) Successful in 53s
Docker Build and Push / integration-test (push) Successful in 2m23s
Main Release / test (push) Successful in 1m55s
Main Release / integration-test (push) Successful in 2m5s
Main Release / build (push) Successful in 2m39s
Docker Build and Push / build (push) Successful in 3m10s
Main Release / tag (push) Successful in 18s
Tag Release / hadolint (push) Successful in 14s
Tag Release / test (push) Successful in 1m40s
Tag Release / integration-test (push) Successful in 1m45s
Tag Release / build-push (push) Successful in 2m46s
Reviewed-on: #48
2026-10-09 16:18:09 -04:00
6 changed files with 42 additions and 8 deletions

No files matched your search

+2 -2
View File
@@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with: with:
python-version: "3.13" python-version: "3.14"
- name: Install dependencies - name: Install dependencies
run: pip install -r requirements.txt pytest run: pip install -r requirements.txt pytest
- name: Run unit tests - name: Run unit tests
@@ -57,7 +57,7 @@ jobs:
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with: with:
python-version: "3.13" python-version: "3.14"
- name: Install dependencies - name: Install dependencies
run: pip install -r requirements.txt pytest run: pip install -r requirements.txt pytest
- name: Run integration tests - name: Run integration tests
+5 -3
View File
@@ -20,9 +20,11 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with: with:
python-version: "3.13" python-version: "3.14"
- name: Install dependencies - name: Install dependencies
run: pip install -r requirements.txt pytest run: pip install -r requirements.txt pytest ruff==0.17.1
- name: Lint (undefined names)
run: ruff check src/ tests/ --select F821
- name: Run unit tests - name: Run unit tests
run: pytest tests/ -v run: pytest tests/ -v
env: env:
@@ -57,7 +59,7 @@ jobs:
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with: with:
python-version: "3.13" python-version: "3.14"
- name: Install dependencies - name: Install dependencies
run: pip install -r requirements.txt pytest run: pip install -r requirements.txt pytest
- name: Run integration tests - name: Run integration tests
+1 -1
View File
@@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with: with:
python-version: "3.13" python-version: "3.14"
- name: Install dependencies - name: Install dependencies
run: pip install -r requirements.txt pytest run: pip install -r requirements.txt pytest
- name: Run unit tests - name: Run unit tests
+2 -2
View File
@@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with: with:
python-version: "3.13" python-version: "3.14"
- name: Install dependencies - name: Install dependencies
run: pip install -r requirements.txt pytest run: pip install -r requirements.txt pytest
- name: Run unit tests - name: Run unit tests
@@ -57,7 +57,7 @@ jobs:
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with: with:
python-version: "3.13" python-version: "3.14"
- name: Install dependencies - name: Install dependencies
run: pip install -r requirements.txt pytest run: pip install -r requirements.txt pytest
- name: Run integration tests - name: Run integration tests
+7
View File
@@ -29,6 +29,13 @@ MAILDIR_FOLDERS = os.environ.get("MAILDIR_FOLDERS", "")
QDRANT_URL = os.environ.get("QDRANT_URL", "") QDRANT_URL = os.environ.get("QDRANT_URL", "")
COLLECTION_NAME = os.environ.get("COLLECTION_NAME", "") COLLECTION_NAME = os.environ.get("COLLECTION_NAME", "")
# Embedding model and batching. EMBEDDING_MODEL_NAME MUST stay in sync with the
# one used by server.py: indexer and server have to embed with the same model,
# otherwise the vectors stored in Qdrant are not comparable with query vectors.
EMBEDDING_MODEL_NAME = os.environ.get("EMBEDDING_MODEL_NAME", "BAAI/bge-small-en-v1.5")
BATCH_SIZE = int(os.environ.get("BATCH_SIZE", "100"))
EMBEDDING_BATCH_SIZE = int(os.environ.get("EMBEDDING_BATCH_SIZE", "64"))
METADATA_COLLECTION = "mcp_indexer_metadata" METADATA_COLLECTION = "mcp_indexer_metadata"
INCREMENTAL_DAYS = int(os.environ.get("INCREMENTAL_DAYS", "7")) INCREMENTAL_DAYS = int(os.environ.get("INCREMENTAL_DAYS", "7"))
FORCE_REINDEX = os.environ.get("FORCE_REINDEX", "").lower() in ("1", "true", "yes") FORCE_REINDEX = os.environ.get("FORCE_REINDEX", "").lower() in ("1", "true", "yes")
+25
View File
@@ -21,6 +21,9 @@ from indexer import (
parse_email_message, parse_email_message,
get_recent_keys, get_recent_keys,
METADATA_COLLECTION, METADATA_COLLECTION,
EMBEDDING_MODEL_NAME,
BATCH_SIZE,
EMBEDDING_BATCH_SIZE,
) )
@@ -227,3 +230,25 @@ class TestGetRecentKeys:
assert key.split(":")[0] in keys assert key.split(":")[0] in keys
for k in keys: for k in keys:
assert ":" not in k assert ":" not in k
# ---------------------------------------------------------------------------
# Regression: module-level constants consumed by main()
# ---------------------------------------------------------------------------
def test_indexer_module_constants_are_defined():
"""Regression (e32806a): the "make indexer importable without env" refactor
dropped these three module-level definitions while main() kept using them,
so every indexer run died with NameError before touching Qdrant."""
assert isinstance(EMBEDDING_MODEL_NAME, str) and EMBEDDING_MODEL_NAME
assert isinstance(BATCH_SIZE, int) and BATCH_SIZE > 0
assert isinstance(EMBEDDING_BATCH_SIZE, int) and EMBEDDING_BATCH_SIZE > 0
def test_embedding_model_is_the_same_as_the_server_one():
"""Indexer and server must embed with the same model, otherwise the vectors
stored by the indexer are not comparable with the query vectors."""
from server import EMBEDDING_MODEL_NAME as server_embedding_model
assert EMBEDDING_MODEL_NAME == server_embedding_model