fix(ci): green main — SUMMARY_MODEL test env + black format + fix app→apps.api imports#40
Merged
Merged
Conversation
…pps.api imports #37 broke CI in three ways: 1. Added SUMMARY_MODEL to Settings (required, no default) but test.yml pytest step lacked the env var → conftest Settings() raised ValidationError on collection. 2. conversations.py needed black formatting. 3. PR #37 was branched before PR #29 (drop app symlink) and reintroduced stale `from app.` / `from app import crud` imports across models, ollama_client, crud, routes, and services — all replaced with `from apps.api.`. Also removed non-existent get_conversation/list_conversations from crud/__init__.py that #37 declared but never implemented. Fix: supply EMBEDDING_MODEL/EMBEDDING_DIMENSIONS/SUMMARY_MODEL in test.yml env, black-format the route file, and restore the apps.api.* import paths throughout. Verified: black --check green, pytest --collect-only 25 tests collected, 0 errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
根因
#37 が CI を3点壊した:
SUMMARY_MODELをSettingsの必須フィールドとして追加したが、test.ymlの pytest step に env 供給がなく、conftest 内Settings()構築でValidationError(exit 4)。conversations.pyが black 未整形。appsymlink band-aid #29 (app シンボリックリンク削除) より前のブランチで開発されており、from app./from app import crudの旧パスが再混入。加えてcrud/__init__.pyがget_conversation/list_conversationsを宣言しているが実装が存在せずImportError。直した内容
.github/workflows/test.ymlEMBEDDING_MODEL,EMBEDDING_DIMENSIONS,SUMMARY_MODELを追加apps/api/api/routes/conversations.pyfrom app import crud→from apps.api import crud; black 整形apps/api/crud/__init__.pyget_conversation/list_conversationsのインポート/__all__を削除apps/api/crud/conversation.pyfrom app.→from apps.api.apps/api/models/conversation.pyfrom app.database import Base→from apps.api.database import Baseapps/api/ollama_client.pyfrom app.→from apps.api.apps/api/services/deriver.pyfrom app import crud→from apps.api import crud;from app.→from apps.api..env.exampleSUMMARY_MODELを必須変数として追記ローカル検証
uv run black --check apps/api/ libs/collectors/→ exit 0 (44 files unchanged)DATABASE_URL=... EMBEDDING_MODEL=qwen3-embedding:8b EMBEDDING_DIMENSIONS=4096 SUMMARY_MODEL=qwen3:14b uv run pytest tests/ --collect-only→ 25 tests collected, 0 errors