Skip to content

Commit af028f7

Browse files
d-csclaude
andcommitted
fix(run-ops split): scalar-only bulk-action queries after group relation drop
The activation schema removed the BulkActionGroup.items and BulkActionItem.group Prisma relations, but PerformBulkActionService still queried them via include, which would fail once the client regenerates. Switch to scalar groupId lookups and read the action kind from BulkActionItem.type. Also drop a stale test comment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c9a70b1 commit af028f7

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

apps/webapp/app/v3/services/bulk/performBulkAction.server.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export class PerformBulkActionService extends BaseService {
1010
const item = await this._prisma.bulkActionItem.findFirst({
1111
where: { id: bulkActionItemId },
1212
include: {
13-
group: true,
1413
sourceRun: true,
1514
destinationRun: true,
1615
},
@@ -24,7 +23,7 @@ export class PerformBulkActionService extends BaseService {
2423
return;
2524
}
2625

27-
switch (item.group.type) {
26+
switch (item.type) {
2827
case "REPLAY": {
2928
const service = new ReplayTaskRunService(this._prisma);
3029
const result = await service.call(item.sourceRun, { triggerSource: "dashboard" });
@@ -57,7 +56,7 @@ export class PerformBulkActionService extends BaseService {
5756
break;
5857
}
5958
default: {
60-
assertNever(item.group.type);
59+
assertNever(item.type);
6160
}
6261
}
6362

@@ -94,17 +93,20 @@ export class PerformBulkActionService extends BaseService {
9493

9594
public async call(bulkActionGroupId: string) {
9695
const actionGroup = await this._prisma.bulkActionGroup.findFirst({
97-
include: {
98-
items: true,
99-
},
10096
where: { id: bulkActionGroupId },
97+
select: { id: true },
10198
});
10299

103100
if (!actionGroup) {
104101
return;
105102
}
106103

107-
for (const item of actionGroup.items) {
104+
const items = await this._prisma.bulkActionItem.findMany({
105+
where: { groupId: bulkActionGroupId },
106+
select: { id: true },
107+
});
108+
109+
for (const item of items) {
108110
await this.enqueueBulkActionItem(item.id, bulkActionGroupId);
109111
}
110112
}

apps/webapp/test/dropTaskRunToTaskRunTagJoin.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// Single-version proof for dropping the dead `_TaskRunToTaskRunTag` implicit join. The
2-
// cross-version follow-up (via heteroPostgresTest) is tracked separately; those helpers
3-
// do not exist in this tree yet.
1+
// Single-version proof for dropping the dead `_TaskRunToTaskRunTag` implicit join.
42

53
import { describe, expect } from "vitest";
64
import { postgresTest } from "@internal/testcontainers";

0 commit comments

Comments
 (0)