Skip to content

Commit 4716a14

Browse files
committed
set full log retention as admin
1 parent a69e04f commit 4716a14

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ export class RunPresenter {
2121
projectSlug,
2222
organizationSlug,
2323
runFriendlyId,
24+
showDeletedLogs,
2425
}: {
2526
userId: string;
2627
projectSlug: string;
2728
organizationSlug: string;
2829
runFriendlyId: string;
30+
showDeletedLogs: boolean;
2931
}) {
3032
const run = await this.#prismaClient.taskRun.findFirstOrThrow({
3133
select: {
@@ -148,7 +150,7 @@ export class RunPresenter {
148150
status: run.status,
149151
isFinished: isFinalRunStatus(run.status),
150152
completedAt: run.completedAt,
151-
logsDeletedAt: run.logsDeletedAt,
153+
logsDeletedAt: showDeletedLogs ? false : run.logsDeletedAt,
152154
rootTaskRun: run.rootTaskRun,
153155
environment: {
154156
id: run.runtimeEnvironment.id,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ import {
8080
import { SpanView } from "../resources.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam.spans.$spanParam/route";
8181
import { useCurrentPlan } from "../_app.orgs.$organizationSlug/route";
8282
import { getResizableSnapshot } from "~/services/resizablePanel.server";
83+
import { getImpersonationId } from "~/services/impersonation.server";
8384

8485
const resizableSettings = {
8586
parent: {
@@ -115,12 +116,14 @@ type TraceEvent = NonNullable<SerializeFrom<typeof loader>["trace"]>["events"][0
115116

116117
export const loader = async ({ request, params }: LoaderFunctionArgs) => {
117118
const userId = await requireUserId(request);
119+
const impersonationId = await getImpersonationId(request);
118120
const { projectParam, organizationSlug, runParam } = v3RunParamsSchema.parse(params);
119121

120122
const presenter = new RunPresenter();
121123
const result = await presenter.call({
122124
userId,
123125
organizationSlug,
126+
showDeletedLogs: !!impersonationId,
124127
projectSlug: projectParam,
125128
runFriendlyId: runParam,
126129
});

0 commit comments

Comments
 (0)