Skip to content

Release: nginx certbot setup + langfuse tracing, tests & coverage#10

Open
GishB wants to merge 2 commits into
mainfrom
develop
Open

Release: nginx certbot setup + langfuse tracing, tests & coverage#10
GishB wants to merge 2 commits into
mainfrom
develop

Conversation

@GishB
Copy link
Copy Markdown
Owner

@GishB GishB commented Apr 30, 2026

Что включено\n\n### PR #8 — nginx + certbot\n- Обновлён docker-compose-prod.yml для корректной работы certbot через webroot\n- Индивидуальные .pem файлы заменены на mount'ы директорий /etc/letsencrypt/live и /etc/letsencrypt/archive (read-only)\n- Добавлен webroot volume: /etc/certbot/www:/var/www/certbot\n\n### PR #9 — langfuse tracing, tests, coverage\n- Внедрён Langfuse tracing с вложенными Redis/Chroma spans внутри LangGraph nodes\n- Добавлены unit-тесты покрытия для всех src/modules интеграций\n- Подключён pytest-cov, сгенерирован coverage.xml\n- Обновлены зависимости (pyproject.toml, uv.lock)\n- Обновлён docker-compose.yml\n- Добавлены evals и скрипты для качества агента\n\n---\nВсе конфликты разрешены, ветка готова к релизу.

GishB added 2 commits April 30, 2026 07:30
* feat(langfuse): nested Redis/Chroma spans inside LangGraph nodes + tests

Observability:
- Added current_span ContextVar to track active LangGraph node span.
- Wrapped all agent nodes (base, core, loop) with manual Langfuse spans;
  LLM callbacks are now scoped to the node span via CallbackHandler(stateful_client=span).
- Updated RedisAdapter and ChromaAdapter to nest their spans under current_span
  instead of attaching directly to the root trace.
- Removed global CallbackHandler from /chat router to avoid duplicate spans.

Tests:
- Added tests/service/api/v1/test_router.py covering /test_invoke (success & 424)
  and /chat (success & rate-limit).
- Added tests/agents/profkom_consultant/nodes/test_base.py for
  update_user_history_context (append, trim, 1:1 sync).

Fixes:
- Fixed history trim bug: model_answers now uses [-HISTORY_LIMIT:] instead of
  [-trim_count:], keeping Q&A lists synchronized.

Deps:
- Added pytest, pytest-asyncio, httpx to dev dependencies.

* chore(tests): add pytest-cov and generate coverage.xml

- Added pytest-cov to dev dependencies.
- Generated coverage.xml from current test suite (7 tests, all passing).

* test(modules): unit-test coverage for all src/modules integrations

Added pytest suites covering:
- redis_ext: RedisAdapter (save/get/spans/health) + UserRateLimiter (incr/remain/reset/ttl/health)
- chroma_ext: ChromaAdapter (init/query/filter/rerank/RAG), MyEmbeddingFunction (retry/batch/call),
  BM25Reranker (fit/rerank), data_reader (chunk/signature/topic), db_writer (sync/orphan cleanup)
- postgres_ext: PostgresClient (pool lifecycle, conn loop, checkpointer, stats, close, health)
- langfuse_ext: LangfuseClient (init, client/handler creation, health_check, on_startup)

Fixes:
- Fixed f-string bug in PostgresClient.get_pool_stats that raised ValueError at runtime.

Coverage:
- Regenerated coverage.xml from full suite (102 tests passing).

* docs(readme): add static test, coverage and python 3.12 badges

* style: fix ruff formatting in 3 files

* Bump version to 0.3.1

* feat: update langfuse tracing, docker compose, add evals and deps
…SL volumes (#8)

* feat(langfuse): nested Redis/Chroma spans inside LangGraph nodes + tests

Observability:
- Added current_span ContextVar to track active LangGraph node span.
- Wrapped all agent nodes (base, core, loop) with manual Langfuse spans;
  LLM callbacks are now scoped to the node span via CallbackHandler(stateful_client=span).
- Updated RedisAdapter and ChromaAdapter to nest their spans under current_span
  instead of attaching directly to the root trace.
- Removed global CallbackHandler from /chat router to avoid duplicate spans.

Tests:
- Added tests/service/api/v1/test_router.py covering /test_invoke (success & 424)
  and /chat (success & rate-limit).
- Added tests/agents/profkom_consultant/nodes/test_base.py for
  update_user_history_context (append, trim, 1:1 sync).

Fixes:
- Fixed history trim bug: model_answers now uses [-HISTORY_LIMIT:] instead of
  [-trim_count:], keeping Q&A lists synchronized.

Deps:
- Added pytest, pytest-asyncio, httpx to dev dependencies.

* chore(tests): add pytest-cov and generate coverage.xml

- Added pytest-cov to dev dependencies.
- Generated coverage.xml from current test suite (7 tests, all passing).

* test(modules): unit-test coverage for all src/modules integrations

Added pytest suites covering:
- redis_ext: RedisAdapter (save/get/spans/health) + UserRateLimiter (incr/remain/reset/ttl/health)
- chroma_ext: ChromaAdapter (init/query/filter/rerank/RAG), MyEmbeddingFunction (retry/batch/call),
  BM25Reranker (fit/rerank), data_reader (chunk/signature/topic), db_writer (sync/orphan cleanup)
- postgres_ext: PostgresClient (pool lifecycle, conn loop, checkpointer, stats, close, health)
- langfuse_ext: LangfuseClient (init, client/handler creation, health_check, on_startup)

Fixes:
- Fixed f-string bug in PostgresClient.get_pool_stats that raised ValueError at runtime.

Coverage:
- Regenerated coverage.xml from full suite (102 tests passing).

* docs(readme): add static test, coverage and python 3.12 badges

* style: fix ruff formatting in 3 files

* Bump version to 0.3.1

* feat: update langfuse tracing, docker compose, add evals and deps

* feat(nginx): update docker-compose-prod.yml for certbot webroot and SSL volumes

- replace individual .pem mounts with live/archive directories (ro)
- add certbot webroot volume /etc/certbot/www:/var/www/certbot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant