Skip to content

Commit 197c3fe

Browse files
committed
Remove all TaskRun.tags readers and replace with TaskRun.runTags
1 parent d63d41f commit 197c3fe

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const commonRunSelect = {
3434
metadata: true,
3535
metadataType: true,
3636
ttl: true,
37-
tags: true,
37+
runTags: true,
3838
costInCents: true,
3939
baseCostInCents: true,
4040
usageDurationMs: true,
@@ -459,9 +459,7 @@ async function createCommonRunStructure(run: CommonRelatedRun, apiVersion: API_V
459459
durationMs: run.usageDurationMs,
460460
isTest: run.isTest,
461461
depth: run.depth,
462-
tags: run.tags
463-
.map((t: { name: string }) => t.name)
464-
.sort((a: string, b: string) => a.localeCompare(b)),
462+
tags: [...(run.runTags ?? [])].sort((a: string, b: string) => a.localeCompare(b)),
465463
...ApiRetrieveRunPresenter.apiBooleanHelpersFromTaskRunStatus(run.status, apiVersion),
466464
triggerFunction: resolveTriggerFunction(run),
467465
batchId: run.batch?.friendlyId,

apps/webapp/app/routes/resources.runs.$runParam.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
2323
taskIdentifier: true,
2424
friendlyId: true,
2525
isTest: true,
26-
tags: {
27-
select: {
28-
name: true,
29-
},
30-
},
26+
runTags: true,
3127
machinePreset: true,
3228
lockedToVersion: {
3329
select: {
@@ -178,7 +174,7 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
178174
run: {
179175
id: run.friendlyId,
180176
createdAt: run.createdAt,
181-
tags: run.tags.map((tag) => tag.name),
177+
tags: run.runTags ?? [],
182178
isTest: run.isTest,
183179
idempotencyKey: run.idempotencyKey ?? undefined,
184180
startedAt: run.startedAt ?? run.createdAt,
@@ -244,7 +240,7 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
244240
isCustomQueue: !run.queue.startsWith("task/"),
245241
concurrencyKey: run.concurrencyKey,
246242
},
247-
tags: run.tags.map((tag) => tag.name),
243+
tags: run.runTags ?? [],
248244
baseCostInCents: run.baseCostInCents,
249245
costInCents: run.costInCents,
250246
totalCostInCents: run.costInCents + run.baseCostInCents,

apps/webapp/app/v3/marqs/sharedQueueConsumer.server.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,6 @@ export class SharedQueueConsumer {
750750
take: 1,
751751
orderBy: { number: "desc" },
752752
},
753-
tags: true,
754753
checkpoints: {
755754
take: 1,
756755
orderBy: {
@@ -1648,7 +1647,7 @@ export const AttemptForExecutionGetPayload = {
16481647
costInCents: true,
16491648
baseCostInCents: true,
16501649
maxDurationInSeconds: true,
1651-
tags: true,
1650+
runTags: true,
16521651
taskEventStore: true,
16531652
},
16541653
},
@@ -1725,7 +1724,7 @@ class SharedQueueTasks {
17251724
context: taskRun.context,
17261725
createdAt: taskRun.createdAt,
17271726
startedAt: taskRun.startedAt ?? taskRun.createdAt,
1728-
tags: taskRun.tags.map((tag) => tag.name),
1727+
tags: taskRun.runTags ?? [],
17291728
isTest: taskRun.isTest,
17301729
idempotencyKey: taskRun.idempotencyKey ?? undefined,
17311730
durationMs: taskRun.usageDurationMs,

apps/webapp/app/v3/services/createTaskRunAttempt.server.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export class CreateTaskRunAttemptService extends BaseService {
5252
runtimeEnvironmentId: environment.id,
5353
},
5454
include: {
55-
tags: true,
5655
attempts: {
5756
take: 1,
5857
orderBy: {
@@ -209,7 +208,7 @@ export class CreateTaskRunAttemptService extends BaseService {
209208
payloadType: taskRun.payloadType,
210209
context: taskRun.context,
211210
createdAt: taskRun.createdAt,
212-
tags: taskRun.tags.map((tag) => tag.name),
211+
tags: taskRun.runTags ?? [],
213212
isTest: taskRun.isTest,
214213
idempotencyKey: taskRun.idempotencyKey ?? undefined,
215214
startedAt: taskRun.startedAt ?? taskRun.createdAt,

0 commit comments

Comments
 (0)