kin: auto-commit after pipeline

This commit is contained in:
Gros Frumos 2026-03-17 15:40:31 +02:00
parent f805aff86b
commit 6c2da26b6c
6 changed files with 138 additions and 10 deletions

View file

@ -206,6 +206,7 @@ class ProjectCreate(BaseModel):
ssh_user: str | None = None
ssh_key_path: str | None = None
ssh_proxy_jump: str | None = None
test_command: str = 'make test'
@model_validator(mode="after")
def validate_fields(self) -> "ProjectCreate":
@ -222,6 +223,7 @@ class ProjectPatch(BaseModel):
auto_test_enabled: bool | None = None
obsidian_vault_path: str | None = None
deploy_command: str | None = None
test_command: str | None = None
project_type: str | None = None
ssh_host: str | None = None
ssh_user: str | None = None
@ -235,6 +237,7 @@ def patch_project(project_id: str, body: ProjectPatch):
body.execution_mode, body.autocommit_enabled is not None,
body.auto_test_enabled is not None,
body.obsidian_vault_path, body.deploy_command is not None,
body.test_command is not None,
body.project_type, body.ssh_host is not None,
body.ssh_user is not None, body.ssh_key_path is not None,
body.ssh_proxy_jump is not None,
@ -262,6 +265,8 @@ def patch_project(project_id: str, body: ProjectPatch):
if body.deploy_command is not None:
# Empty string = sentinel for clearing (decision #68)
fields["deploy_command"] = None if body.deploy_command == "" else body.deploy_command
if body.test_command is not None:
fields["test_command"] = body.test_command
if body.project_type is not None:
fields["project_type"] = body.project_type
if body.ssh_host is not None:
@ -366,6 +371,8 @@ def create_project(body: ProjectCreate):
ssh_key_path=body.ssh_key_path,
ssh_proxy_jump=body.ssh_proxy_jump,
)
if body.test_command != "make test":
p = models.update_project(conn, body.id, test_command=body.test_command)
conn.close()
return p