Skip to content

Commit 4532412

Browse files
committed
chore: Add Artifact Deletion Warning
1 parent 02df683 commit 4532412

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/components/shared/ReactFlow/FlowCanvas/TaskNode/TaskOverview/IOSection/IOSection.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ import { BlockStack } from "@/components/ui/layout";
55
import { Spinner } from "@/components/ui/spinner";
66
import { Paragraph } from "@/components/ui/typography";
77
import { useBackend } from "@/providers/BackendProvider";
8+
import { useExecutionData } from "@/providers/ExecutionDataProvider";
89
import { getExecutionArtifacts } from "@/services/executionService";
910
import { getBackendStatusString } from "@/utils/backend";
1011
import type { TaskSpec } from "@/utils/componentSpec";
12+
import { THIRTY_DAYS_IN_MS } from "@/utils/constants";
1113

1214
import IOExtras from "./IOExtras";
1315
import IOInputs from "./IOInputs";
@@ -21,6 +23,7 @@ interface IOSectionProps {
2123

2224
const IOSection = ({ taskSpec, executionId, readOnly }: IOSectionProps) => {
2325
const { backendUrl, configured, available } = useBackend();
26+
const { metadata } = useExecutionData();
2427

2528
const {
2629
data: artifacts,
@@ -74,8 +77,19 @@ const IOSection = ({ taskSpec, executionId, readOnly }: IOSectionProps) => {
7477
? ["inputs", "outputs", "other"]
7578
: ["outputs", "inputs", "other"];
7679

80+
const isOlderThan30Days =
81+
metadata?.created_at &&
82+
Date.now() - new Date(metadata.created_at).getTime() > THIRTY_DAYS_IN_MS;
83+
7784
return (
7885
<BlockStack gap="4" className="w-full">
86+
{isOlderThan30Days && (
87+
<InfoBox title="Artifact Storage" variant="warning">
88+
Remote artifacts may be unavailable for runs older than 30 days. To
89+
keep an artifact, download it using the provided link before it
90+
expires.
91+
</InfoBox>
92+
)}
7993
{order.map((section) => {
8094
if (section === "inputs") {
8195
return (

src/utils/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export const EXIT_CODE_OOM = 137; // SIGKILL (128 + 9) - Out of Memory
7878
// Time constants
7979
export const ONE_MINUTE_IN_MS = 60 * 1000;
8080
export const TWENTY_FOUR_HOURS_IN_MS = 24 * 60 * 60 * 1000;
81+
export const THIRTY_DAYS_IN_MS = 30 * 24 * 60 * 60 * 1000;
8182

8283
export const ROOT_TASK_ID = "root";
8384

0 commit comments

Comments
 (0)