Fix geo_re_resolve async mocks and mark tasks complete
This commit is contained in:
@@ -158,6 +158,8 @@ After completing TASK B-5, a `geo_service` method (or via `geo_cache_repo` throu
|
||||
|
||||
#### TASK B-8 — Remove `print()` from `geo_service.py` docstring example
|
||||
|
||||
**Status:** Completed ✅
|
||||
|
||||
**Violated rule:** Refactoring.md §4 / Backend-Development.md §2 — Never use `print()` in production code; use `structlog`.
|
||||
|
||||
**Files affected:**
|
||||
@@ -229,6 +231,8 @@ Remove or rewrite the docstring snippet so it does not contain a bare `print()`
|
||||
|
||||
#### TASK F-1 — Wrap `SetupPage` API calls in a dedicated hook
|
||||
|
||||
**Status:** Completed ✅
|
||||
|
||||
**Violated rule:** Refactoring.md §3.1 — Pages must not call API functions from `src/api/` directly; all data fetching goes through hooks.
|
||||
|
||||
**Files affected:**
|
||||
@@ -409,6 +413,8 @@ For each component listed:
|
||||
|
||||
#### TASK B-13 — Remove `Any` type annotations in `jail_service.py`
|
||||
|
||||
**Status:** Completed ✅
|
||||
|
||||
**Violated rule:** Backend-Development.md §1 — Never use `Any`; all functions must have explicit type annotations.
|
||||
|
||||
**Files affected:**
|
||||
@@ -424,6 +430,8 @@ For each component listed:
|
||||
|
||||
#### TASK B-14 — Remove `Any` type annotations in `health_service.py`
|
||||
|
||||
**Status:** Completed ✅
|
||||
|
||||
**Violated rule:** Backend-Development.md §1 — Never use `Any`; all functions must have explicit type annotations.
|
||||
|
||||
**Files affected:**
|
||||
@@ -439,6 +447,8 @@ For each component listed:
|
||||
|
||||
#### TASK B-15 — Remove `Any` type annotations in `blocklist_service.py`
|
||||
|
||||
**Status:** Completed ✅
|
||||
|
||||
**Violated rule:** Backend-Development.md §1 — Never use `Any`; all functions must have explicit type annotations.
|
||||
|
||||
**Files affected:**
|
||||
@@ -454,6 +464,8 @@ For each component listed:
|
||||
|
||||
#### TASK B-16 — Remove `Any` type annotations in `import_log_repo.py`
|
||||
|
||||
**Status:** Completed ✅
|
||||
|
||||
**Violated rule:** Backend-Development.md §1 — Never use `Any`; all functions must have explicit type annotations.
|
||||
|
||||
**Files affected:**
|
||||
@@ -470,6 +482,8 @@ For each component listed:
|
||||
|
||||
#### TASK B-17 — Remove `Any` type annotations in `config_file_service.py`
|
||||
|
||||
**Status:** Completed ✅
|
||||
|
||||
**Violated rule:** Backend-Development.md §1 — Never use `Any`; all functions must have explicit type annotations.
|
||||
|
||||
**Files affected:**
|
||||
@@ -485,6 +499,8 @@ For each component listed:
|
||||
|
||||
#### TASK B-18 — Remove `Any` type annotations in `fail2ban_client.py`
|
||||
|
||||
**Status:** Completed ✅
|
||||
|
||||
**Violated rule:** Backend-Development.md §1 — Never use `Any`; all functions must have explicit type annotations.
|
||||
|
||||
**Files affected:**
|
||||
@@ -500,6 +516,8 @@ For each component listed:
|
||||
|
||||
#### TASK B-19 — Remove `Any` annotations from background tasks
|
||||
|
||||
**Status:** Completed ✅
|
||||
|
||||
**Violated rule:** Backend-Development.md §1 — Never use `Any`; all functions must have explicit type annotations.
|
||||
|
||||
**Files affected:**
|
||||
@@ -517,6 +535,8 @@ For each component listed:
|
||||
|
||||
#### TASK B-20 — Remove `type: ignore` in `dependencies.get_settings`
|
||||
|
||||
**Status:** Completed ✅
|
||||
|
||||
**Violated rule:** Backend-Development.md §1 — Avoid `Any` and ignored type errors.
|
||||
|
||||
**Files affected:**
|
||||
@@ -527,3 +547,19 @@ For each component listed:
|
||||
1. Introduce a typed model (e.g., `TypedDict` or `Protocol`) for `app.state` to declare `settings: Settings` and other shared state properties.
|
||||
2. Update `get_settings` (and any other helpers that read from `app.state`) so the return type is inferred as `Settings` without needing a `type: ignore` comment.
|
||||
3. Run `mypy --strict` or `pyright` to confirm the type ignore is no longer needed.
|
||||
|
||||
---
|
||||
|
||||
#### TASK B-21 — Fix `geo_re_resolve` test mocks to support async calls
|
||||
|
||||
**Status:** Completed ✅
|
||||
|
||||
**Violated rule:** Test code must correctly mock async coroutines (`AsyncMock`) when awaited.
|
||||
|
||||
**Files affected:**
|
||||
- `backend/tests/test_tasks/test_geo_re_resolve.py` — patched `geo_service` to ensure `get_unresolved_ips` is an `AsyncMock`.
|
||||
|
||||
**What to do:**
|
||||
|
||||
1. Ensure all mocks for async service methods are `AsyncMock` so they can be awaited.
|
||||
2. Run `pytest -q -c backend/pyproject.toml` to confirm the test suite passes.
|
||||
|
||||
Reference in New Issue
Block a user