kin: auto-commit after pipeline

This commit is contained in:
Gros Frumos 2026-03-17 19:30:15 +02:00
parent e7c65c22e5
commit 0e522e54a9
7 changed files with 363 additions and 65 deletions

View file

@ -218,7 +218,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'
test_command: str | None = None
@model_validator(mode="after")
def validate_fields(self) -> "ProjectCreate":
@ -294,7 +294,8 @@ def patch_project(project_id: str, body: ProjectPatch):
if body.deploy_restart_cmd is not None:
fields["deploy_restart_cmd"] = None if body.deploy_restart_cmd == "" else body.deploy_restart_cmd
if body.test_command is not None:
fields["test_command"] = body.test_command
# Empty string = sentinel for enabling auto-detect (stores NULL)
fields["test_command"] = None if body.test_command == "" else body.test_command
if body.project_type is not None:
fields["project_type"] = body.project_type
if body.ssh_host is not None:
@ -419,7 +420,7 @@ 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":
if body.test_command is not None:
p = models.update_project(conn, body.id, test_command=body.test_command)
conn.close()
return p