Strengthen CI and streamline test coverage#1
Conversation
Lazy-initialize the SQLAlchemy engine and session maker so they are not created at import time, allowing tests to run without a live database. Add a dummy default for database_url and update tests accordingly.
- Add ruff.toml with 30+ rule families (security, async, FastAPI, pytest, etc.) - Ban relative imports and __future__ annotations (Python 3.13+) - Rename BaseException → BaseError, NoEntityFoundException → NoEntityFoundError - Replace id params with entity_id to avoid shadowing builtins - Convert to absolute imports, modern type syntax, and Annotated dependencies - Auto-fix trailing whitespace, import sorting, and deprecated typing imports
- Enable double quote enforcement, annotation checks, import conventions, implicit namespace package detection, and logging format rules - Add missing type annotations across all source files - Create app/__init__.py to satisfy INP001 - Convert alembic migration quotes to double quotes
- Create ty.toml with promoted rules: division-by-zero, deprecated, undefined-reveal, unused-awaitable, redundant-cast, redundant-final-classvar, possibly-missing-implicit-call, possibly-missing-submodule - Ban getattr, setattr, hasattr via ruff flake8-tidy-imports - Fix logger wrappers: remove **kwargs forwarding to match logging API - Fix entity route: reorder params to avoid default-before-required - Remove stale ty:ignore comment from settings - Upgrade all deps (ty 0.0.13->0.0.26, ruff 0.14->0.15, fastapi, etc.)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a679998372
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Makefile
Outdated
| uv run pytest tests/unit -m unit | ||
|
|
||
| test-integration: | ||
| uv run pytest tests/integration -m integration |
There was a problem hiding this comment.
Remove stale integration test target
The new test-integration target points to tests/integration, but this commit only adds tests/unit/** and no tests/integration directory exists. As a result, make test-integration fails immediately instead of running any tests, which breaks any local or CI workflow still invoking this documented target.
Useful? React with 👍 / 👎.
Summary
This PR tightens the template's quality gates and reshapes the test strategy around fast, deterministic unit coverage. It adds Ruff and Ty to the CI/CD workflow, expands automated checks around application lifecycle and error handling, fixes startup-time database initialization issues, and removes the Docker-backed integration suite in favor of a leaner unit-only pipeline.
Change log
Confidence code
0.92