From e4eb4cd932cb8bc931d4d1e1b3fd70a6dedc806d Mon Sep 17 00:00:00 2001 From: AdrianoDev Date: Mon, 27 Apr 2026 13:10:58 +0200 Subject: [PATCH] docs: refresh stato + roadmap with smoke-test findings; fix sort syntax MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit STATO_PROGETTO.md - Bumped snapshot date to 2026-04-27. - Added "Hardening post-restructure (smoke test 2026-04-26)" section recording the four runtime regressions surfaced by the local smoke test (env_file path, missing Station import, UPLOAD_DIR default, apostrophe-in-translation in Alpine), plus the recipe-assignment modal UX rework and the new node-based JS syntax test guard. - Added "Smoke test status" section listing the verified end-to-end flow (MySQL up, alembic, seed, login, admin pages, MeasurementTec workflow, hot reload). - Bumped frontend test count 44 → 46 to reflect test_template_js_syntax.py. ROADMAP.md - Added a tech-debt entry for the user-reported task_complete riepilogo rendering anomaly (still under investigation: the curl fetch returns the table populated, but the user reports an empty body in the browser). - Added a tech-debt entry for the still-pending Docker container smoke test of the new uv-based Dockerfiles. src/frontend/flask_app/templates/measure/task_complete.html - Replaced sort(attribute='task_info.order_index,subtask.marker_number') with two chained stable sorts. Jinja's sort filter does not accept a comma-separated multi-attribute string; the previous form sorted on a non-existent attribute and only worked by accident because the API already returned rows in the desired order. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/architecture/ROADMAP.md | 2 ++ docs/architecture/STATO_PROGETTO.md | 35 +++++++++++++++---- .../templates/measure/task_complete.html | 4 ++- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/docs/architecture/ROADMAP.md b/docs/architecture/ROADMAP.md index 1f0f2db..e430954 100644 --- a/docs/architecture/ROADMAP.md +++ b/docs/architecture/ROADMAP.md @@ -57,10 +57,12 @@ Da: master plan §0 "Precondizioni e Decisioni Aperte". Da risolvere col cliente |---|---|---| | 3 test backend pre-esistenti rotti (`test_recipes`, `test_tasks`) | Media | Investigare prima di Fase 3 (toccano recipe + task router). | | 1 test client pre-esistente rotto (`test_save_measurement_proxy`) | Bassa | Probabilmente CSRF/payload. Risolvere con Fase 4. | +| Pagina `task_complete` riepilogo: utente segnala riga vuota in alcuni scenari | Media | Da debuggare (rendering corretto via curl ma utente vede vuoto in browser, possibile interazione con sessione lot/serial). | | `.env` rename a convenzione spec (SERVICE_NAME, SERVICE_DOMAIN, API_KEY) | Bassa | Rinviato (impatto deploy). | | Header `X-API-Key` rename a `X-Api-Key` | Bassa | Vedere se M2 lo richiede. | | Envelope risposta `{success,data,error}` | Bassa | Eventuale API v2 in M2. | | `Dockerfile.frontend`: `pybabel compile` via `uv run` non testato in build reale | Alta | Verificare al primo `docker compose build`. | +| Smoke test in container Docker (non solo locale uvicorn+gunicorn) | Alta | Validare che i Dockerfile riscritti con `uv` buildino e girino correttamente prima di chiudere V2.0.0. | ## Open per scelta utente prima della prossima sessione diff --git a/docs/architecture/STATO_PROGETTO.md b/docs/architecture/STATO_PROGETTO.md index cbbd495..2691426 100644 --- a/docs/architecture/STATO_PROGETTO.md +++ b/docs/architecture/STATO_PROGETTO.md @@ -1,6 +1,6 @@ # Stato Progetto TieMeasureFlow — V2.0.0 -> Snapshot al 2026-04-25. Aggiornare ad ogni milestone. +> Snapshot al 2026-04-27. Aggiornare ad ogni milestone. ## Versione corrente @@ -56,6 +56,19 @@ Il sistema base (V1.0.7) è completo e collaudato: ricette, task, misurazioni, S - Alembic env.py aggiunge project root a `sys.path`; `script_location = %(here)s` resta valido. - `.dockerignore` aggiornato. +### Hardening post-restructure (smoke test 2026-04-26) + +Sequenza di smoke test in locale (uvicorn + gunicorn + MySQL Docker) ha fatto emergere quattro regressioni che sarebbero rimaste invisibili al test suite: + +- **`src/backend/config.py`**: `env_file` era cwd-relative (`../../.env`). Rotto fuori da `src/backend/`. Risolto con percorso assoluto `Path(__file__).resolve().parents[2] / ".env"`. +- **`src/backend/models/orm/__init__.py`**: `Station` e `StationRecipeAssignment` non erano esportati, quindi `Base.metadata.create_all` non creava le tabelle stations. Aggiunti agli import. +- **`.env.example`**: `UPLOAD_DIR=server/uploads` era residuo della vecchia struttura → file landavano fuori dall'albero di progetto. Aggiornato a `UPLOAD_DIR=uploads`. +- **Apostrofi italiani in template Alpine** (`l'utente`, `nell'eliminazione`, `nell'assegnazione`): chiudevano prematuramente JS string literals dentro `x-text` e blocchi `