From e4566d51a6917ef3c09806b9c85646b19fe148ba Mon Sep 17 00:00:00 2001 From: Gros Frumos Date: Mon, 16 Mar 2026 10:08:50 +0200 Subject: [PATCH] =?UTF-8?q?kin:=20KIN-ARCH-007=20=D0=94=D0=BE=D1=87=D0=B8?= =?UTF-8?q?=D1=81=D1=82=D0=B8=D1=82=D1=8C=20=D0=BE=D1=81=D1=82=D0=B0=D0=B2?= =?UTF-8?q?=D1=88=D0=B8=D0=B5=D1=81=D1=8F=20workaround=20path=3D''=20?= =?UTF-8?q?=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20KIN-ARCH-003?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_api.py | 8 ++------ tests/test_models.py | 3 ++- web/frontend/src/views/TaskDetail.vue | 6 +++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index 6226dfd..440236c 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1354,7 +1354,6 @@ def test_create_operations_project_with_ssh_fields(client): r = client.post("/api/projects", json={ "id": "srv1", "name": "My Server", - "path": "", "project_type": "operations", "ssh_host": "10.0.0.1", "ssh_user": "root", @@ -1364,6 +1363,7 @@ def test_create_operations_project_with_ssh_fields(client): assert r.status_code == 200 data = r.json() assert data["project_type"] == "operations" + assert data["path"] is None assert data["ssh_host"] == "10.0.0.1" assert data["ssh_user"] == "root" assert data["ssh_key_path"] == "~/.ssh/id_rsa" @@ -1397,7 +1397,6 @@ def test_create_operations_project_without_ssh_host_allowed(client): r = client.post("/api/projects", json={ "id": "srv2", "name": "Server No SSH", - "path": "", "project_type": "operations", }) # Фикс KIN-ARCH-001: был 200, стал 422 @@ -1417,7 +1416,6 @@ def test_kin_arch_001_operations_without_ssh_host_returns_422(client): r = client.post("/api/projects", json={ "id": "ops_no_ssh", "name": "Ops Without SSH", - "path": "", "project_type": "operations", }) assert r.status_code == 422 @@ -1429,7 +1427,6 @@ def test_kin_arch_001_operations_with_empty_ssh_host_returns_422(client): r = client.post("/api/projects", json={ "id": "ops_empty_ssh", "name": "Ops Empty SSH", - "path": "", "project_type": "operations", "ssh_host": "", }) @@ -1442,13 +1439,13 @@ def test_kin_arch_001_operations_with_valid_ssh_host_returns_200(client): r = client.post("/api/projects", json={ "id": "ops_with_ssh", "name": "Ops With SSH", - "path": "", "project_type": "operations", "ssh_host": "10.0.0.42", }) assert r.status_code == 200 data = r.json() assert data["project_type"] == "operations" + assert data["path"] is None assert data["ssh_host"] == "10.0.0.42" @@ -1484,7 +1481,6 @@ def test_kin_arch_001_422_error_message_mentions_ssh_host(client): r = client.post("/api/projects", json={ "id": "ops_err_msg", "name": "Check Error Message", - "path": "", "project_type": "operations", }) assert r.status_code == 422 diff --git a/tests/test_models.py b/tests/test_models.py index 6ea342c..95284e8 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -84,10 +84,11 @@ def test_create_development_project_defaults(conn): def test_update_project_ssh_fields(conn): """KIN-071: update_project can set SSH fields.""" - models.create_project(conn, "srv2", "Server 2", "", project_type="operations") + models.create_project(conn, "srv2", "Server 2", project_type="operations") updated = models.update_project(conn, "srv2", ssh_host="192.168.1.1", ssh_user="pelmen") assert updated["ssh_host"] == "192.168.1.1" assert updated["ssh_user"] == "pelmen" + assert updated["path"] is None # --------------------------------------------------------------------------- diff --git a/web/frontend/src/views/TaskDetail.vue b/web/frontend/src/views/TaskDetail.vue index 974b097..6ce3259 100644 --- a/web/frontend/src/views/TaskDetail.vue +++ b/web/frontend/src/views/TaskDetail.vue @@ -38,7 +38,7 @@ const autoMode = ref(false) function loadMode(t: typeof task.value) { if (!t) return if (t.execution_mode) { - autoMode.value = t.execution_mode === 'auto' + autoMode.value = t.execution_mode === 'auto_complete' } else if (t.status === 'review') { // Task is in review — always show Approve/Reject regardless of localStorage autoMode.value = false @@ -52,7 +52,7 @@ async function toggleMode() { autoMode.value = !autoMode.value localStorage.setItem(`kin-mode-${task.value.project_id}`, autoMode.value ? 'auto' : 'review') try { - const updated = await api.patchTask(props.id, { execution_mode: autoMode.value ? 'auto' : 'review' }) + const updated = await api.patchTask(props.id, { execution_mode: autoMode.value ? 'auto_complete' : 'review' }) task.value = { ...task.value, ...updated } } catch (e: any) { error.value = e.message @@ -343,7 +343,7 @@ async function saveEdit() {

{{ task.id }}

{{ task.title }} - 🔓 auto