Skip to content

Commit 6ea9607

Browse files
committed
Added the Batch to the run inspector
1 parent 2bd66a7 commit 6ea9607

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ export class SpanPresenter extends BasePresenter {
149149
spanId: true,
150150
},
151151
},
152+
batch: {
153+
select: {
154+
friendlyId: true,
155+
},
156+
},
152157
},
153158
where: {
154159
spanId,
@@ -312,6 +317,7 @@ export class SpanPresenter extends BasePresenter {
312317
context: JSON.stringify(context, null, 2),
313318
metadata,
314319
maxDurationInSeconds: getMaxDuration(run.maxDurationInSeconds),
320+
batch: run.batch ? { friendlyId: run.batch.friendlyId } : undefined,
315321
};
316322
}
317323

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam.spans.$spanParam/route.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ import { requireUserId } from "~/services/session.server";
5656
import { cn } from "~/utils/cn";
5757
import { formatCurrencyAccurate } from "~/utils/numberFormatter";
5858
import {
59+
v3BatchPath,
60+
v3BatchRunsPath,
5961
v3RunDownloadLogsPath,
6062
v3RunPath,
6163
v3RunSpanPath,
@@ -583,6 +585,21 @@ function RunBody({
583585
</>
584586
)
585587
) : null}
588+
{run.batch && (
589+
<Property.Item>
590+
<Property.Label>Batch</Property.Label>
591+
<Property.Value>
592+
<SimpleTooltip
593+
button={
594+
<TextLink to={v3BatchPath(organization, project, run.batch)}>
595+
{run.batch.friendlyId}
596+
</TextLink>
597+
}
598+
content={`Jump to ${run.batch.friendlyId}`}
599+
/>
600+
</Property.Value>
601+
</Property.Item>
602+
)}
586603
<Property.Item>
587604
<Property.Label>Version</Property.Label>
588605
<Property.Value>

apps/webapp/app/utils/pathBuilder.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,14 @@ export function v3BatchesPath(organization: OrgForPath, project: ProjectForPath)
441441
return `${v3ProjectPath(organization, project)}/batches`;
442442
}
443443

444+
export function v3BatchPath(
445+
organization: OrgForPath,
446+
project: ProjectForPath,
447+
batch: { friendlyId: string }
448+
) {
449+
return `${v3ProjectPath(organization, project)}/batches?batchId=${batch.friendlyId}`;
450+
}
451+
444452
export function v3BatchRunsPath(
445453
organization: OrgForPath,
446454
project: ProjectForPath,

0 commit comments

Comments
 (0)