kin: auto-commit after pipeline
This commit is contained in:
parent
fe344c2a4f
commit
d53c4096fd
9 changed files with 343 additions and 22 deletions
24
web/api.py
24
web/api.py
|
|
@ -897,6 +897,30 @@ def approve_task(task_id: str, body: TaskApprove | None = None):
|
|||
}
|
||||
|
||||
|
||||
class FollowupBody(BaseModel):
|
||||
dry_run: bool = False
|
||||
|
||||
|
||||
@app.post("/api/tasks/{task_id}/followup")
|
||||
def followup_task(task_id: str, body: FollowupBody | None = None):
|
||||
"""Generate follow-up tasks for a blocked or completed task."""
|
||||
from core.followup import generate_followups
|
||||
|
||||
conn = get_conn()
|
||||
t = models.get_task(conn, task_id)
|
||||
if not t:
|
||||
conn.close()
|
||||
raise HTTPException(404, f"Task '{task_id}' not found")
|
||||
dry_run = body.dry_run if body else False
|
||||
result = generate_followups(conn, task_id, dry_run=dry_run)
|
||||
conn.close()
|
||||
return {
|
||||
"created": result["created"],
|
||||
"pending_actions": result["pending_actions"],
|
||||
"needs_decision": len(result["pending_actions"]) > 0,
|
||||
}
|
||||
|
||||
|
||||
class ResolveAction(BaseModel):
|
||||
action: dict
|
||||
choice: str # "rerun" | "manual_task" | "skip"
|
||||
|
|
|
|||
|
|
@ -40,12 +40,12 @@ const BASE_PROJECT = {
|
|||
autocommit_enabled: null,
|
||||
auto_test_enabled: null,
|
||||
obsidian_vault_path: null,
|
||||
deploy_command: null,
|
||||
test_command: null,
|
||||
deploy_host: null,
|
||||
deploy_path: null,
|
||||
deploy_runtime: null,
|
||||
deploy_restart_cmd: null,
|
||||
deploy_command: null as string | null,
|
||||
test_command: null as string | null,
|
||||
deploy_host: null as string | null,
|
||||
deploy_path: null as string | null,
|
||||
deploy_runtime: null as string | null,
|
||||
deploy_restart_cmd: null as string | null,
|
||||
created_at: '2024-01-01',
|
||||
total_tasks: 0,
|
||||
done_tasks: 0,
|
||||
|
|
|
|||
|
|
@ -70,12 +70,12 @@ const BASE_PROJECT = {
|
|||
autocommit_enabled: null,
|
||||
auto_test_enabled: null,
|
||||
obsidian_vault_path: null,
|
||||
deploy_command: null,
|
||||
test_command: null,
|
||||
deploy_host: null,
|
||||
deploy_path: null,
|
||||
deploy_runtime: null,
|
||||
deploy_restart_cmd: null,
|
||||
deploy_command: null as string | null,
|
||||
test_command: null as string | null,
|
||||
deploy_host: null as string | null,
|
||||
deploy_path: null as string | null,
|
||||
deploy_runtime: null as string | null,
|
||||
deploy_restart_cmd: null as string | null,
|
||||
created_at: '2024-01-01',
|
||||
total_tasks: 0,
|
||||
done_tasks: 0,
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ describe('тогл видимости', () => {
|
|||
const wrapper = mountConsole()
|
||||
const panel = wrapper.find('[class*="bg-gray-950"]')
|
||||
// v-show=false — элемент в DOM, но display: none
|
||||
expect(panel.element.style.display).toBe('none')
|
||||
expect((panel.element as HTMLElement).style.display).toBe('none')
|
||||
wrapper.unmount()
|
||||
})
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ describe('тогл видимости', () => {
|
|||
await wrapper.find('button').trigger('click')
|
||||
await flushPromises()
|
||||
const panel = wrapper.find('[class*="bg-gray-950"]')
|
||||
expect(panel.element.style.display).not.toBe('none')
|
||||
expect((panel.element as HTMLElement).style.display).not.toBe('none')
|
||||
wrapper.unmount()
|
||||
})
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ describe('тогл видимости', () => {
|
|||
await wrapper.find('button').trigger('click')
|
||||
await flushPromises()
|
||||
const panel = wrapper.find('[class*="bg-gray-950"]')
|
||||
expect(panel.element.style.display).toBe('none')
|
||||
expect((panel.element as HTMLElement).style.display).toBe('none')
|
||||
wrapper.unmount()
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue