Skip to content

fix: show contextual artifact unavailability message in preview dialog#2181

Open
morgan-wowk wants to merge 1 commit intomasterfrom
artifact-retention-msgs
Open

fix: show contextual artifact unavailability message in preview dialog#2181
morgan-wowk wants to merge 1 commit intomasterfrom
artifact-retention-msgs

Conversation

@morgan-wowk
Copy link
Copy Markdown

@morgan-wowk morgan-wowk commented Apr 29, 2026

Description

Introduces a typed ArtifactFetchError class that carries HTTP status and statusText, replacing generic Error throws in both getArtifactSignedUrl and useArtifactFetch. This allows the artifact visualizer to distinguish between 404 (not found) and other failure states and render appropriate inline notices.

Adds a new ArtifactRetentionNotice component that displays a configurable warning or error InfoBox with a message driven by the VITE_ARTIFACT_RETENTION_DAYS environment variable. When the variable is set, the message includes the specific number of days; otherwise it falls back to a generic expiry message.

The existing hardcoded 30-day retention warning in IOSection is replaced with this new component, now respecting VITE_ARTIFACT_RETENTION_DAYS instead of a fixed threshold. The artifact visualizer's SuspenseWrapper now uses an errorFallback that renders a retention notice on 404 and an error-variant notice for all other failures.

Related Issue and Pull requests

Type of Change

  • Bug fix
  • Improvement

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Before screenshots

image.png

image.png

After screenshots

Screenshot 2026-04-29 at 4.29.25 PM.png

image.png

image.png

Test Instructions

  1. Open a task node with artifact outputs on a run older than the configured retention period and verify the ArtifactRetentionNotice warning appears in the IO section.
  2. Open an artifact visualizer for an artifact that returns a 404 and confirm the "Artifact unavailable" warning notice is shown.
  3. Simulate a non-404 fetch failure and confirm the "Failed to load artifact" error notice is shown with the HTTP status detail.
  4. Set VITE_ARTIFACT_RETENTION_DAYS to a specific value and verify the expiry message includes that number of days.
  5. Unset VITE_ARTIFACT_RETENTION_DAYS and verify the generic expiry message is shown instead.

Additional Comments

The Object.setPrototypeOf call in ArtifactFetchError ensures instanceof checks work correctly when targeting ES5 in TypeScript.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

🎩 Preview

A preview build has been created at: artifact-retention-msgs/8c77875

Copy link
Copy Markdown
Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@morgan-wowk morgan-wowk force-pushed the artifact-retention-msgs branch 9 times, most recently from d6fbf9f to 5fe2f3f Compare April 30, 2026 00:15
@morgan-wowk morgan-wowk marked this pull request as ready for review April 30, 2026 00:20
@morgan-wowk morgan-wowk requested a review from a team as a code owner April 30, 2026 00:20
Comment on lines +182 to +187
<ArtifactRetentionNotice
title="Failed to load artifact"
variant="error"
preamble={`An unexpected error occurred${statusDetail}.`}
specific
/>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semantics here are a little confusing: given you're using this new component for both a Retention Notice and general errors you may want to consider a bit of renaming and/or splitting responsibilities between multiple components.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is split into multiple components per your suggestion.

@morgan-wowk morgan-wowk force-pushed the artifact-retention-msgs branch from 5fe2f3f to 8c77875 Compare April 30, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants