Add routines automation workflows

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta
2026-03-19 08:39:24 -05:00
parent 7a652b8998
commit 8f5196f7d6
35 changed files with 25977 additions and 5 deletions

View File

@@ -27,6 +27,7 @@ import {
documentService,
logActivity,
projectService,
routineService,
workProductService,
} from "../services/index.js";
import { logger } from "../middleware/logger.js";
@@ -49,6 +50,7 @@ export function issueRoutes(db: Db, storage: StorageService) {
const executionWorkspacesSvc = executionWorkspaceService(db);
const workProductsSvc = workProductService(db);
const documentsSvc = documentService(db);
const routinesSvc = routineService(db);
const upload = multer({
storage: multer.memoryStorage(),
limits: { fileSize: MAX_ATTACHMENT_BYTES, files: 1 },
@@ -236,6 +238,10 @@ export function issueRoutes(db: Db, storage: StorageService) {
projectId: req.query.projectId as string | undefined,
parentId: req.query.parentId as string | undefined,
labelId: req.query.labelId as string | undefined,
originKind: req.query.originKind as string | undefined,
originId: req.query.originId as string | undefined,
includeRoutineExecutions:
req.query.includeRoutineExecutions === "true" || req.query.includeRoutineExecutions === "1",
q: req.query.q as string | undefined,
});
res.json(result);
@@ -855,6 +861,7 @@ export function issueRoutes(db: Db, storage: StorageService) {
res.status(404).json({ error: "Issue not found" });
return;
}
await routinesSvc.syncRunStatusForIssue(issue.id);
// Build activity details with previous values for changed fields
const previous: Record<string, unknown> = {};