kin: auto-commit after pipeline

This commit is contained in:
Gros Frumos 2026-03-17 17:39:40 +02:00
parent 248934d5d7
commit 939a30a3de
6 changed files with 796 additions and 3 deletions

View file

@ -72,6 +72,10 @@ export interface Project {
obsidian_vault_path: string | null
deploy_command: string | null
test_command: string | null
deploy_host: string | null
deploy_path: string | null
deploy_runtime: string | null
deploy_restart_cmd: string | null
created_at: string
total_tasks: number
done_tasks: number
@ -155,18 +159,54 @@ export interface PipelineStep {
created_at: string
}
export interface DeployStepResult {
step: string
stdout: string
stderr: string
exit_code: number
}
export interface DependentDeploy {
project_id: string
project_name: string
success: boolean
results: DeployStepResult[]
}
export interface DeployResult {
success: boolean
exit_code: number
stdout: string
stderr: string
duration_seconds: number
steps?: string[]
results?: DeployStepResult[]
dependents_deployed?: DependentDeploy[]
overall_success?: boolean
}
export interface ProjectLink {
id: number
from_project: string
to_project: string
link_type: string
description: string | null
created_at: string
}
export interface TaskFull extends Task {
pipeline_steps: PipelineStep[]
related_decisions: Decision[]
project_deploy_command: string | null
pipeline_id: string | null
}
export interface PipelineLog {
id: number
ts: string
level: 'INFO' | 'DEBUG' | 'ERROR' | 'WARN'
message: string
extra_json: Record<string, unknown> | null
}
export interface PendingAction {
@ -317,7 +357,7 @@ export const api = {
post<{ updated: string[]; count: number }>(`/projects/${projectId}/audit/apply`, { task_ids: taskIds }),
patchTask: (id: string, data: { status?: string; execution_mode?: string; priority?: number; route_type?: string; title?: string; brief_text?: string; acceptance_criteria?: string }) =>
patch<Task>(`/tasks/${id}`, data),
patchProject: (id: string, data: { execution_mode?: string; autocommit_enabled?: boolean; auto_test_enabled?: boolean; obsidian_vault_path?: string; deploy_command?: string; test_command?: string; project_type?: string; ssh_host?: string; ssh_user?: string; ssh_key_path?: string; ssh_proxy_jump?: string }) =>
patchProject: (id: string, data: { execution_mode?: string; autocommit_enabled?: boolean; auto_test_enabled?: boolean; obsidian_vault_path?: string; deploy_command?: string; test_command?: string; project_type?: string; ssh_host?: string; ssh_user?: string; ssh_key_path?: string; ssh_proxy_jump?: string; deploy_host?: string; deploy_path?: string; deploy_runtime?: string; deploy_restart_cmd?: string }) =>
patch<Project>(`/projects/${id}`, data),
deployProject: (projectId: string) =>
post<DeployResult>(`/projects/${projectId}/deploy`, {}),
@ -367,4 +407,12 @@ export const api = {
deleteAttachment: (taskId: string, id: number) =>
del<void>(`/tasks/${taskId}/attachments/${id}`),
attachmentUrl: (id: number) => `${BASE}/attachments/${id}/file`,
getPipelineLogs: (pipelineId: string, sinceId: number) =>
get<PipelineLog[]>(`/pipelines/${pipelineId}/logs?since_id=${sinceId}`),
projectLinks: (projectId: string) =>
get<ProjectLink[]>(`/projects/${projectId}/links`),
createProjectLink: (data: { from_project: string; to_project: string; link_type: string; description?: string }) =>
post<ProjectLink>('/project-links', data),
deleteProjectLink: (id: number) =>
del<void>(`/project-links/${id}`),
}