naeel
764592ba60
fix: код-ревью #5 #6 #8 #9 #10 — 5 исправлений (v1.2.43)
...
#5 api_history: try/finally для conn/cur (как везде)
#6 stand_name: точное сравнение URL вместо substring
#8 get_real_client: удалён мёртвый алиас
#9 UNIQUE индекс idx_runs_op_uid для предотвращения гонок
#10 flock flush: f.flush() перед LOCK_UN в ротации лога
#7 (отступ scenario.py) пропущен — только косметика, риск сломать else:
2026-08-04 08:02:08 +04:00
naeel
126500a30b
fix: whitelist mode/polygon_stand — защита от мусора в cookie (v1.2.42)
...
Результат код-ревью #3 :
mode/polygon_stand принимали любые значения из формы.
Добавлена валидация в main.py (set_mode) и auth.py (get_mode, get_polygon_stand):
mode ∈ {polygon, cloud}, stand ∈ {dev, test, prod}.
2026-08-04 07:32:06 +04:00
naeel
cc7805a429
perf: кеширование detect_endpoint в flask.g — минус 2 HTTP-запроса (v1.2.41)
...
Результат код-ревью #2 :
get_client() и get_stand() вызывали detect_endpoint() независимо
→ двойной HTTP-запрос к Nubes API на каждый рендер страницы.
_cached_detect(token) кеширует результат в flask.g на время запроса.
2026-08-04 07:26:26 +04:00
naeel
9a801e6bff
fix: URL полигона — стенд перед /api/v1/svc, а не после (v1.2.31)
...
Было: https://polygon.../api/v1/svc/test/instances → 404
Стало: https://polygon.../test/api/v1/svc/instances → OK
Замена /api/v1/svc → /{stand}/api/v1/svc.
2026-08-03 08:56:29 +04:00
naeel
0a62eb3c58
feat: селектор режима и стенда (v1.2.30)
...
Новое:
- Селектор режима (🎭 Эмуляция / ☁️ Облако) над версией
- Селектор стенда (DEV/TEST/PROD) в режиме эмуляции
- В эмуляции — всё в полигон (/stand/api/v1/svc)
- В эмуляции — токен дезактивирован
- По умолчанию: эмуляция + TEST
Изменено:
- auth.py: get_mode(), get_polygon_stand(), get_client() с префиксом стенда
- main.py: action=set_mode, единый get_client() вместо real_client/inst_client
- index.html: селекторы, disable токена
- service_list.py: обрезка polygon_ префикса
- api_test.py: get_real_client → get_client
Задокументировано в HISTORY/2026-08-03-session.md.
2026-08-03 08:50:14 +04:00
naeel
dcd978808d
fix: разделение клиентов — сервисы из real API, инстансы/операции из polygon (v1.2.28)
2026-08-01 09:22:02 +04:00
naeel
4a0cfcaa61
feat: POLYGON_ENDPOINT — отдельная переменная, не трогает NUBES_API_TOKEN (v1.2.26)
2026-07-31 23:42:41 +04:00
naeel
a398892766
feat: интеграция с polygon — STANDS-check в get_client/get_stand (v1.2.24)
2026-07-31 22:45:27 +04:00
naeel
0783319fd1
Рефакторинг API-слоя, операций и БД
2026-07-31 17:13:54 +04:00
naeel
91e97f6f75
v1.2.0: unified executor + flexible instance refs + params-render.js
...
Phase 1 — New modules:
- api/utils.py: find_uid(), uid_from_location() (replaces 2 duplicates)
- operations/poll.py: poll_until_done() (shared sync/async polling)
- operations/executor.py: execute_operation() (single CREATE/non-CREATE flow)
Phase 2 — Format + validation:
- routes/api_scenario_defs.py: _validate_steps with output/instance_ref/instance_uid
- operations/scenario.py: resolve instance_uid > instance_ref > service_id,
use executor + poll_until_done, persist instance_bindings
Phase 3 — Migration:
- routes/api_test.py: create/non-create through executor, _finish_op through poll_until_done
- db/init_db.py: startup cleanup of stuck scenario_runs (>1h)
Phase 4 — UI shared module:
- static/js/params-render.js: renderParamRow, renderMapFixedRow, collectParams
- static/js/operations.js: use params-render.js (remove duplicates)
- templates/index.html: include params-render.js
- app.py: bump 1.1.57 → 1.2.0
2026-07-31 08:55:06 +04:00
naeel
7354d9c125
v1.1.52: fix scenario create (drop svcOperationId) + http_client _status debug
2026-07-30 15:51:22 +04:00
naeel
67f6390509
v1.1.49: UUID extraction directly in http_client.post() — Location header → instanceUid/instanceOperationUid
2026-07-30 14:37:35 +04:00
naeel
9c062a225e
v1.1.36: CMDB raw_delete uses clean requests (no auth headers)
2026-07-30 07:14:25 +04:00
naeel
65d10d5c35
v1.1.33: CMDB delete logging — log HTTP status code
2026-07-29 14:09:56 +04:00
naeel
d17c84548d
v1.1.31: CMDB hard delete + fix _resolve_ref_svc params update
2026-07-29 13:48:49 +04:00
naeel
5af8c5218f
v1.1.28: HttpClient.get() resilient to empty body — return {} instead of JSONDecodeError
2026-07-29 13:32:17 +04:00
naeel
f6a7bf76c5
v1.0.90: Steps 1-4 — auth.py, dedup, httponly cookie, _op_results TTL
2026-07-27 22:56:51 +04:00
naeel
1cc3f6eb7e
v1.0.89: detailed code comments — all Python files + index.html architecture overview
2026-07-27 22:02:51 +04:00
naeel
59e87cf50f
v1.0.85: create_client(token) everywhere — single entry point stand detection; {{ stand }} in UI
2026-07-27 17:26:09 +04:00
naeel
338c080254
v1.0.54: fix 4 audit bugs — _client auto-detect, _find_uid by key, tracker_add before params, flock LOCK_NB
2026-07-27 10:18:49 +04:00
naeel
72dd5ad5ae
Fix: send {} body for POST, not None, v1.0.33
2026-07-24 14:19:48 +04:00
naeel
26d71c87eb
Fix: use /instanceOperationCfsParams endpoint, v1.0.28
2026-07-24 13:56:01 +04:00
naeel
2ae1f5dd66
Fix: r.json() returns string, check isinstance, v1.0.21
2026-07-24 09:23:07 +04:00
naeel
9a096f45d2
Show error response body on HTTP failures, v1.0.12
2026-07-24 08:40:11 +04:00
naeel
f0639ff032
Extract instanceUid from Location header, v1.0.9
2026-07-24 08:21:05 +04:00
naeel
d91b3cc446
Fix POST returning empty JSON body, v1.0.8
2026-07-24 08:18:18 +04:00
naeel
098cc2ace6
Add HttpClient.post, dummy-only, remove reconcile, v1.0.7
2026-07-24 07:49:37 +04:00
naeel
51f4508c1d
Add modules: api, operations, routes with org display
2026-07-23 11:28:11 +04:00
naeel
6cb8c05f05
Strip to minimal: single route, static HTML, no logic
2026-07-23 11:10:33 +04:00
naeel
420d09e6b5
Restructure: site/ with modular code, matching Nubes Flask convention
2026-07-23 10:48:14 +04:00