From 9f73055e16626bd22f1db40dc3c4c4999d5a9f29 Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Wed, 8 Oct 2025 10:26:47 +0300 Subject: [PATCH] PM-2355 - add a new field "gitRunUrl" for the aiWorkflowRun --- .../20251008071010_add_ai_workflow_run_url_field/migration.sql | 2 ++ prisma/schema.prisma | 1 + src/shared/modules/global/workflow-queue.handler.ts | 2 ++ 3 files changed, 5 insertions(+) create mode 100644 prisma/migrations/20251008071010_add_ai_workflow_run_url_field/migration.sql diff --git a/prisma/migrations/20251008071010_add_ai_workflow_run_url_field/migration.sql b/prisma/migrations/20251008071010_add_ai_workflow_run_url_field/migration.sql new file mode 100644 index 0000000..ad46231 --- /dev/null +++ b/prisma/migrations/20251008071010_add_ai_workflow_run_url_field/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "aiWorkflowRun" ADD COLUMN "gitRunUrl" TEXT; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index af30372..0839fcc 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -626,6 +626,7 @@ model aiWorkflowRun { startedAt DateTime? @db.Timestamp(3) completedAt DateTime? @db.Timestamp(3) gitRunId String @db.VarChar + gitRunUrl String? @db.Text score Float? @db.DoublePrecision status String @db.VarChar usage Json? @db.JsonB diff --git a/src/shared/modules/global/workflow-queue.handler.ts b/src/shared/modules/global/workflow-queue.handler.ts index 4c9c65e..166e827 100644 --- a/src/shared/modules/global/workflow-queue.handler.ts +++ b/src/shared/modules/global/workflow-queue.handler.ts @@ -120,6 +120,7 @@ export class WorkflowQueueHandler implements OnModuleInit { workflow_job: { id: number; run_id: string; + html_url: string; name: string; conclusion: string; }; @@ -198,6 +199,7 @@ export class WorkflowQueueHandler implements OnModuleInit { where: { id: aiWorkflowRunId }, data: { gitRunId: `${event.workflow_job.run_id}`, + gitRunUrl: `${event.workflow_job.html_url}`, jobsCount, completedJobs: { increment: 1 }, },