From 37e8851f674da1f9ab8a35e07b9594511a1ea0fc Mon Sep 17 00:00:00 2001 From: Dotta Date: Wed, 17 Jun 2026 14:37:24 +0000 Subject: [PATCH] fix routine annotation ci coverage Co-Authored-By: Paperclip --- server/src/__tests__/routines-e2e.test.ts | 12 +++++++ server/src/routes/openapi.ts | 40 +++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/server/src/__tests__/routines-e2e.test.ts b/server/src/__tests__/routines-e2e.test.ts index 8e2f0f88558..b93c148a03a 100644 --- a/server/src/__tests__/routines-e2e.test.ts +++ b/server/src/__tests__/routines-e2e.test.ts @@ -10,6 +10,11 @@ import { companies, companyMemberships, createDb, + documentAnnotationAnchorSnapshots, + documentAnnotationComments, + documentAnnotationThreads, + documentRevisions, + documents, executionWorkspaces, heartbeatRunEvents, heartbeatRuns, @@ -18,6 +23,7 @@ import { principalPermissionGrants, projectWorkspaces, projects, + routineDocuments, routineRuns, routines, routineTriggers, @@ -96,6 +102,9 @@ describeEmbeddedPostgres("routine routes end-to-end", () => { afterEach(async () => { await db.delete(activityLog); + await db.delete(documentAnnotationAnchorSnapshots); + await db.delete(documentAnnotationComments); + await db.delete(documentAnnotationThreads); await db.delete(routineRuns); await db.delete(routineTriggers); await db.delete(heartbeatRunEvents); @@ -106,7 +115,10 @@ describeEmbeddedPostgres("routine routes end-to-end", () => { await db.delete(projectWorkspaces); await db.delete(principalPermissionGrants); await db.delete(companyMemberships); + await db.delete(routineDocuments); await db.delete(routines); + await db.delete(documentRevisions); + await db.delete(documents); await db.delete(projects); await db.delete(agents); await db.delete(companies); diff --git a/server/src/routes/openapi.ts b/server/src/routes/openapi.ts index 38dc905f8a9..7786ff92eb6 100644 --- a/server/src/routes/openapi.ts +++ b/server/src/routes/openapi.ts @@ -611,6 +611,8 @@ const CREATED_OPERATIONS = new Set([ "POST /api/companies/{companyId}/labels", "POST /api/issues/{id}/documents/{key}/annotations", "POST /api/issues/{id}/documents/{key}/annotations/{threadId}/comments", + "POST /api/routines/{id}/description/annotations", + "POST /api/routines/{id}/description/annotations/{threadId}/comments", "POST /api/issues/{id}/work-products", "POST /api/issues/{id}/low-trust/promotions", "POST /api/issues/{id}/approvals", @@ -4396,6 +4398,44 @@ registerCurrentRoute({ body: updateDocumentAnnotationThreadSchema, }); +for (const route of [ + ["get", "/api/routines/{id}/description/annotations", "List routine description annotation threads"], + ["get", "/api/routines/{id}/description/annotations/{threadId}", "Get a routine description annotation thread"], +] as const) { + registerCurrentRoute({ + method: route[0], + path: route[1], + tags: ["routines"], + summary: route[2], + }); +} + +registerCurrentRoute({ + method: "post", + path: "/api/routines/{id}/description/annotations", + tags: ["routines"], + summary: "Create a routine description annotation thread", + body: createDocumentAnnotationThreadSchema, + responses: { 201: r.ok(), 400: r.badRequest, 401: r.unauthorized, 404: r.notFound }, +}); + +registerCurrentRoute({ + method: "post", + path: "/api/routines/{id}/description/annotations/{threadId}/comments", + tags: ["routines"], + summary: "Add a routine description annotation comment", + body: createDocumentAnnotationCommentSchema, + responses: { 201: r.ok(), 400: r.badRequest, 401: r.unauthorized, 404: r.notFound }, +}); + +registerCurrentRoute({ + method: "patch", + path: "/api/routines/{id}/description/annotations/{threadId}", + tags: ["routines"], + summary: "Update a routine description annotation thread", + body: updateDocumentAnnotationThreadSchema, +}); + registerCurrentRoute({ method: "get", path: "/api/issues/{id}/recovery-actions",