refactoring-backend #3
@@ -1,29 +1,3 @@
|
||||
### Issue #51: MEDIUM - Repository Boundary Not Type-Enforced
|
||||
|
||||
**Where found**:
|
||||
- `backend/app/dependencies.py:20-25` – documented constraint that routers must not import `DbDep` directly
|
||||
|
||||
**Why this is needed**:
|
||||
Nothing prevents a developer from bypassing the service/repository layer and accessing the DB directly from a router, violating the layered architecture and making the codebase harder to test.
|
||||
|
||||
**Goal**:
|
||||
Make architectural violations detectable automatically.
|
||||
|
||||
**What to do**:
|
||||
1. Add a custom `flake8` or `ruff` rule (or `import-linter` boundary) that forbids `app.routers.*` from importing `app.dependencies.DbDep`.
|
||||
2. Add a CI check that runs the import boundary linter.
|
||||
|
||||
**Possible traps and issues**:
|
||||
- `import-linter` requires defining contracts in `pyproject.toml`; coordinate with the existing linting setup.
|
||||
|
||||
**Docs changes needed**:
|
||||
- `CONTRIBUTING.md`: document the layer boundary rule and linting check.
|
||||
|
||||
**Doc references**:
|
||||
- `backend/app/dependencies.py` module docstring
|
||||
|
||||
---
|
||||
|
||||
### Issue #52: MEDIUM - Error Handling Patterns Not Declared on Services
|
||||
|
||||
**Where found**:
|
||||
|
||||
Reference in New Issue
Block a user