naeel
539cfd7b1a
fix: дубликаты RUNNING/OK в истории — UPSERT по op_uid (v1.2.37)
...
Причина: save_run всегда делал INSERT, сценарий вызывал его дважды
(до поллинга RUNNING, после OK) → две строки в БД.
Исправление:
- init_db.py: частичный уникальный индекс idx_runs_op_uid
- save_run.py: INSERT ... ON CONFLICT (op_uid) DO UPDATE
(статус, длительность, ошибка, этапы, meta — обновляются)
2026-08-03 10:00:29 +04:00
naeel
c1e7c4f9aa
v1.2.23: lock_check three-state return (True/False/None), None→503 DB unavailable
2026-07-31 18:22:58 +04:00
naeel
23688da90a
v1.2.22: 3rd audit fixes — UniqueViolation→409, lock_check no-db→False, escName add & escape
2026-07-31 18:20:33 +04:00
naeel
06eb463088
v1.2.21: fix broken advisory lock (→ partial unique index), escName add " escape, lock_check fallback False
2026-07-31 18:17:09 +04:00
naeel
5065019ffd
v1.2.20: remaining Codex fixes — _op_results lock, advisory lock for scenarios, _ensure_schema logging, stale async generation token, validate-cfs explicit JSONDecodeError
2026-07-31 18:07:24 +04:00
naeel
c50aaf59d8
Подробные комментарии ко всем JS-файлам фронтенда
2026-07-31 17:25:44 +04:00
naeel
0783319fd1
Рефакторинг API-слоя, операций и БД
2026-07-31 17:13:54 +04:00
naeel
82a3be2067
v1.2.16: save full instance metadata (instance_meta JSONB)
...
init_db.py: ALTER TABLE runs ADD instance_meta JSONB
save_run.py: +instance_meta parameter → JSONB insert
api_test.py: _finish_op fetches GET /instances/{uid} after poll, saves all fields
scenario.py: run_scenario same — per-step instance metadata
Excludes: instanceUid, displayName, svc, serviceId, explainedStatus (already in other columns)
2026-07-31 14:19:29 +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
a96658b9b5
v1.1.55: split large files + CRUD scenario editor
...
Backend (5→7 files):
- api_test.py: 622→479, terraform functions → operations/terraform.py (142)
- api_scenario.py: 241→split into run (153) + defs (108) with _validate_steps()
- db/scenario_defs.py: +client_id, stand, is_seed in list_definitions
Frontend (1→10 files):
- app.js: 554→16 (loader), split into:
utils.js (45), instances.js (89), operations.js (249),
history.js (35), scenario-list.js (90)
- New CRUD: scenario-form.js (128), create (25), edit (12), delete (13)
Max file size: JS 249, PY 479
2026-07-30 22:02:22 +04:00
naeel
6f051aa348
v1.1.51: fix seed — list/get also match global defaults (client_id='' stand='')
2026-07-30 15:25:16 +04:00
naeel
983b387708
v1.1.50: scenario_definitions DB+CRUD, seed, runner from DB, 409 lock, UI definitions, drop config.yaml scenarios
2026-07-30 15:06:05 +04:00
naeel
7f69c916ec
v1.1.48: fix 4 scenario bugs — save_run: scenario_run_id+step_number, run_id before thread (202), TIMEOUT op_data init, RUNNING before API call, GET /run/<id>
2026-07-30 14:08:29 +04:00
naeel
7eeb1131b3
v1.1.46: phase2 — scenario runner MVP (YAML config, DB schema, API endpoints, UI section)
2026-07-30 13:48:34 +04:00
naeel
515fadbcde
v1.1.21: 6 fixes — _finish_op args, connection leak, pool init, XSS, secure cookie, let
2026-07-29 12:01:00 +04:00
naeel
3dbddda858
v1.0.99: debug logging for save_run — will show why it fails
2026-07-28 10:42:43 +04:00
naeel
99b0a79cbd
v1.0.95: full test data — op_uid, user_email, app_version, params saved to runs
2026-07-28 10:12:16 +04:00
naeel
163dd02419
v1.0.94: lazy schema init — pool.py runs init_db on first DB access, not at import
2026-07-28 09:56:44 +04:00
naeel
5e120db0d6
v1.0.93: separate DB_* env vars (DB_HOST, DB_PORT, DB_NAME, DB_USER, DB_PASSWORD, DB_SSLMODE) + TEST endpoint default
2026-07-28 09:50:00 +04:00
naeel
7fc17ab3cd
v1.0.92: back to DATABASE_URL — JSON format for jsonEnv
2026-07-28 09:37:14 +04:00
naeel
d239458d97
v1.0.92: separate DB_* env vars instead of DATABASE_URL
2026-07-28 09:35:40 +04:00
naeel
d95afc60e3
v1.0.92: Steps 5-9 — dynamic services, PostgreSQL history, /api/history
2026-07-27 22:59:52 +04:00