[PR #402] [MERGED] Sync SEO dashboard imports in app/main and add route smoke test #709

Closed
opened 2026-03-13 21:05:04 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AJaySi/ALwrity/pull/402
Author: @AJaySi
Created: 3/9/2026
Status: Merged
Merged: 3/9/2026
Merged by: @AJaySi

Base: mainHead: codex/update-imports-and-add-smoke-tests


📝 Commits (1)

  • e8d76cd Sync SEO dashboard imports and add route smoke test

📊 Changes

3 files changed (+70 additions, -2 deletions)

View changed files

📝 backend/app.py (+12 -1)
📝 backend/main.py (+2 -1)
backend/tests/test_seo_dashboard_routes_smoke.py (+56 -0)

📄 Description

Motivation

  • Prevent drift between the two FastAPI entrypoints and ensure route handlers reference only imported symbols for the SEO dashboard.
  • Expose the same SEO dashboard surface (cache-stats, sif-health, etc.) from both backend.app and backend.main so route registration is consistent.

Description

  • Added get_semantic_cache_stats and get_sif_indexing_health to the from api.seo_dashboard import (...) list in backend/app.py and synced the same imports into backend/main.py.
  • Implemented the /api/seo-dashboard/sif-health route handler in backend/app.py that returns get_sif_indexing_health(current_user) so the route uses an explicitly imported symbol.
  • Added a startup/route smoke test at backend/tests/test_seo_dashboard_routes_smoke.py that imports backend.app and backend.main, stubs lightweight optional dependencies (e.g., spacy), sets minimal environment defaults for Stripe mapping, and asserts the registration of /api/seo-dashboard/cache-stats and /api/seo-dashboard/sif-health.
  • Kept import lists in backend/app.py and backend/main.py in sync to avoid future drift.

Testing

  • Ran the smoke test with pytest -q backend/tests/test_seo_dashboard_routes_smoke.py and the test suite reported 2 passed.
  • The smoke test imports both entrypoints and verifies the two routes are present, providing an automated guard against import/registration regressions.

Codex Task


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AJaySi/ALwrity/pull/402 **Author:** [@AJaySi](https://github.com/AJaySi) **Created:** 3/9/2026 **Status:** ✅ Merged **Merged:** 3/9/2026 **Merged by:** [@AJaySi](https://github.com/AJaySi) **Base:** `main` ← **Head:** `codex/update-imports-and-add-smoke-tests` --- ### 📝 Commits (1) - [`e8d76cd`](https://github.com/AJaySi/ALwrity/commit/e8d76cd7457a6cc70241c8cd52f3e20f8237f73b) Sync SEO dashboard imports and add route smoke test ### 📊 Changes **3 files changed** (+70 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `backend/app.py` (+12 -1) 📝 `backend/main.py` (+2 -1) ➕ `backend/tests/test_seo_dashboard_routes_smoke.py` (+56 -0) </details> ### 📄 Description ### Motivation - Prevent drift between the two FastAPI entrypoints and ensure route handlers reference only imported symbols for the SEO dashboard. - Expose the same SEO dashboard surface (`cache-stats`, `sif-health`, etc.) from both `backend.app` and `backend.main` so route registration is consistent. ### Description - Added `get_semantic_cache_stats` and `get_sif_indexing_health` to the `from api.seo_dashboard import (...)` list in `backend/app.py` and synced the same imports into `backend/main.py`. - Implemented the `/api/seo-dashboard/sif-health` route handler in `backend/app.py` that returns `get_sif_indexing_health(current_user)` so the route uses an explicitly imported symbol. - Added a startup/route smoke test at `backend/tests/test_seo_dashboard_routes_smoke.py` that imports `backend.app` and `backend.main`, stubs lightweight optional dependencies (e.g., `spacy`), sets minimal environment defaults for Stripe mapping, and asserts the registration of `/api/seo-dashboard/cache-stats` and `/api/seo-dashboard/sif-health`. - Kept import lists in `backend/app.py` and `backend/main.py` in sync to avoid future drift. ### Testing - Ran the smoke test with `pytest -q backend/tests/test_seo_dashboard_routes_smoke.py` and the test suite reported `2 passed`. - The smoke test imports both entrypoints and verifies the two routes are present, providing an automated guard against import/registration regressions. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69abc21f70488328b284a069099e91d7) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-13 21:05:04 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ALwrity#709
No description provided.