[PR #381] [CLOSED] Align SEO dashboard imports/routes and add app router smoke test #686

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

📋 Pull Request Information

Original PR: https://github.com/AJaySi/ALwrity/pull/381
Author: @AJaySi
Created: 3/5/2026
Status: Closed

Base: mainHead: codex/update-api-imports-and-add-smoke-test


📝 Commits (1)

  • 10d498c Align SEO dashboard route imports and add app smoke test

📊 Changes

3 files changed (+43 additions, -1 deletions)

View changed files

📝 backend/app.py (+12 -1)
📝 backend/main.py (+1 -0)
backend/tests/test_app_router_smoke.py (+30 -0)

📄 Description

Motivation

  • Ensure functions referenced by route handlers are actually imported so app.py and main.py remain consistent and avoid runtime errors when routes are used.
  • Add a lightweight startup/router smoke test to catch import/route registration regressions early in CI/dev environments.
  • Avoid removing app.py routes because app.py is still used as an entrypoint and is not deprecated in the repo's startup path.

Description

  • Updated backend/app.py api.seo_dashboard import list to include get_semantic_cache_stats and get_sif_indexing_health and added the /api/seo-dashboard/sif-health route handler.
  • Updated backend/main.py api.seo_dashboard import list to include get_semantic_cache_stats so the two entry modules are consistent.
  • Added a lightweight smoke test at backend/tests/test_app_router_smoke.py which imports the app and verifies the router has the /api/seo-dashboard/sif-health and /api/seo-dashboard/cache-stats paths, while stubbing spacy and setting a minimal STRIPE_PLAN_PRICE_MAPPING_TEST env var to keep imports stable in test environments.
  • Did not remove duplicate definitions or deprecate app.py because the repository startup scripts reference app:app, so both files were aligned instead.

Testing

  • Ran cd backend && pytest -q tests/test_app_router_smoke.py and the smoke test passed (1 passed) while existing unrelated deprecation/warning noise was observed but did not affect the test outcome.

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/381 **Author:** [@AJaySi](https://github.com/AJaySi) **Created:** 3/5/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/update-api-imports-and-add-smoke-test` --- ### 📝 Commits (1) - [`10d498c`](https://github.com/AJaySi/ALwrity/commit/10d498cf0b614effc3158a77a040b425262f84e5) Align SEO dashboard route imports and add app smoke test ### 📊 Changes **3 files changed** (+43 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/app.py` (+12 -1) 📝 `backend/main.py` (+1 -0) ➕ `backend/tests/test_app_router_smoke.py` (+30 -0) </details> ### 📄 Description ### Motivation - Ensure functions referenced by route handlers are actually imported so `app.py` and `main.py` remain consistent and avoid runtime errors when routes are used. - Add a lightweight startup/router smoke test to catch import/route registration regressions early in CI/dev environments. - Avoid removing `app.py` routes because `app.py` is still used as an entrypoint and is not deprecated in the repo's startup path. ### Description - Updated `backend/app.py` `api.seo_dashboard` import list to include `get_semantic_cache_stats` and `get_sif_indexing_health` and added the `/api/seo-dashboard/sif-health` route handler. - Updated `backend/main.py` `api.seo_dashboard` import list to include `get_semantic_cache_stats` so the two entry modules are consistent. - Added a lightweight smoke test at `backend/tests/test_app_router_smoke.py` which imports the app and verifies the router has the `/api/seo-dashboard/sif-health` and `/api/seo-dashboard/cache-stats` paths, while stubbing `spacy` and setting a minimal `STRIPE_PLAN_PRICE_MAPPING_TEST` env var to keep imports stable in test environments. - Did not remove duplicate definitions or deprecate `app.py` because the repository startup scripts reference `app:app`, so both files were aligned instead. ### Testing - Ran `cd backend && pytest -q tests/test_app_router_smoke.py` and the smoke test passed (`1 passed`) while existing unrelated deprecation/warning noise was observed but did not affect the test outcome. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69a9a286f46483289ff13862b994b938) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-13 21:03:44 +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#686
No description provided.