docs: Sonnet FULL code review — all 17 files
This commit is contained in:
@@ -0,0 +1,51 @@
|
|||||||
|
# Полный код-ревью ВСЕГО проекта autotest
|
||||||
|
|
||||||
|
## Контекст
|
||||||
|
|
||||||
|
Flask 3.0 + gunicorn (multi-worker) + vanilla JS + psycopg2 PostgreSQL.
|
||||||
|
Тестирует Nubes REST API — создаёт/удаляет инстансы облачных сервисов.
|
||||||
|
Версия: v1.1.20 (сегодня, после 20 правок за день).
|
||||||
|
За день сделано ~20 правок, накопился технический долг — нужен свежий взгляд.
|
||||||
|
|
||||||
|
## ВСЕ файлы (прочитай КАЖДЫЙ)
|
||||||
|
|
||||||
|
```
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/app.py — точка входа, регистрация blueprint'ов
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/runner.py — загрузка config.yaml
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/api/auth.py — get_token, get_client, get_client_id, get_stand
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/api/http_client.py — HttpClient, detect_endpoint, stand_name
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/db/pool.py — psycopg2 ThreadedConnectionPool (lazy)
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/db/init_db.py — CREATE TABLE runs + миграции
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/db/save_run.py — INSERT в runs (16 колонок)
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/operations/get_instances.py — GET /instances (пагинация)
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/operations/get_params.py — get_params_with_current_values, _normalize_value_list
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/operations/get_services.py — GET /services, /services/{id}
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/operations/service_list.py — load_service_ids из services_{stand}.txt
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/operations/tracker.py — fcntl.flock file tracker
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/routes/api.py — LEGACY эндпоинты
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/routes/api_test.py — ОСНОВНОЙ: /api/test, /api/params, /api/log, поллинг, _finish_op
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/routes/main.py — / (главная), /api/operations/{svc_id}
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/static/app.js — ВЕСЬ фронтенд (420 строк)
|
||||||
|
/home/naeel/nubes/autotest/app-autotest/site/templates/index.html — Jinja2 шаблон
|
||||||
|
```
|
||||||
|
|
||||||
|
## Что нужно от тебя
|
||||||
|
|
||||||
|
1. **Найти ВСЕ баги** — синтаксические, логические, race conditions, необработанные исключения
|
||||||
|
2. **Проверить универсальность** — работает ли код для ВСЕХ сервисов (Redis 3 параметра, PostgreSQL 8 map-fixed параметров, Болванка)
|
||||||
|
3. **Проверить CREATE flow** — сверь с эталонным Terraform flow из /home/naeel/nubes/autotest/DOCS/terraform-operations-full-logic.md
|
||||||
|
4. **Проверить MODIFY/SUSPEND/DELETE/RESUME** — нет ли там таких же проблем
|
||||||
|
5. **Проверить фронтенд** — все ли DOM ID совпадают, нет ли необработанных Promise, правильный ли порядок элементов
|
||||||
|
6. **Проверить на дубликаты** — нет ли мёртвого кода, дублирующихся эндпоинтов
|
||||||
|
7. **Проверить безопасность** — httponly cookie, токены, CORS
|
||||||
|
|
||||||
|
## Известные недавние баги (уже исправлены, но проверь что фиксы корректны)
|
||||||
|
|
||||||
|
- `_client()` → NameError (не было такой функции) → заменили на get_client()
|
||||||
|
- `-строка` → TypeError в сортировке → заменили на два sort()
|
||||||
|
- `_normalize_value_list` не импортирован → добавили импорт
|
||||||
|
- `</div>\`;` осиротевший HTML в JS → удалили
|
||||||
|
- `currentSvcName` вместо реального `i.svc` → исправили
|
||||||
|
- serviceId фильтр (убран, заменён на сортировку)
|
||||||
|
- dataDescriptor defaultValue не прокидывался → добавили
|
||||||
|
- required+default params не досылались (шаг 6 Terraform) → добавили
|
||||||
Reference in New Issue
Block a user