kin: KIN-049 Кнопка Deploy на странице задачи после approve. Для каждого проекта настраивается deploy-команда (git push, scp, ssh restart). В Settings проекта.
This commit is contained in:
parent
860ef3f6c9
commit
d50bd703ae
11 changed files with 517 additions and 61 deletions
|
|
@ -48,21 +48,6 @@ def _collect_pipeline_output(conn: sqlite3.Connection, task_id: str) -> str:
|
|||
return "\n".join(parts)
|
||||
|
||||
|
||||
def _next_task_id(conn: sqlite3.Connection, project_id: str) -> str:
|
||||
"""Generate the next sequential task ID for a project."""
|
||||
prefix = project_id.upper()
|
||||
existing = models.list_tasks(conn, project_id=project_id)
|
||||
max_num = 0
|
||||
for t in existing:
|
||||
tid = t["id"]
|
||||
if tid.startswith(prefix + "-"):
|
||||
try:
|
||||
num = int(tid.split("-", 1)[1])
|
||||
max_num = max(max_num, num)
|
||||
except ValueError:
|
||||
pass
|
||||
return f"{prefix}-{max_num + 1:03d}"
|
||||
|
||||
|
||||
def generate_followups(
|
||||
conn: sqlite3.Connection,
|
||||
|
|
@ -154,7 +139,7 @@ def generate_followups(
|
|||
"options": ["rerun", "manual_task", "skip"],
|
||||
})
|
||||
else:
|
||||
new_id = _next_task_id(conn, project_id)
|
||||
new_id = models.next_task_id(conn, project_id)
|
||||
brief_dict = {"source": f"followup:{task_id}"}
|
||||
if item.get("type"):
|
||||
brief_dict["route_type"] = item["type"]
|
||||
|
|
@ -206,7 +191,7 @@ def resolve_pending_action(
|
|||
return None
|
||||
|
||||
if choice == "manual_task":
|
||||
new_id = _next_task_id(conn, project_id)
|
||||
new_id = models.next_task_id(conn, project_id)
|
||||
brief_dict = {"source": f"followup:{task_id}", "task_type": "manual_escalation"}
|
||||
if item.get("type"):
|
||||
brief_dict["route_type"] = item["type"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue