Skip to content

feat(preprod): Decide artifact expiry from the dates on the row - #132003

Draft
lcian wants to merge 3 commits into
lcian/feat/preprod-artifact-expiryfrom
lcian/feat/preprod-expiry-reads
Draft

lcian wants to merge 3 commits into
lcian/feat/preprod-artifact-expiryfrom
lcian/feat/preprod-expiry-reads

Conversation

@lcian

@lcian lcian commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

The builds list and the size analysis endpoints hide a build once it is older than the organization's current Size Analysis retention, so a plan change also changes which existing builds can be read. They now compare the dates that were stamped on the artifact when it was created.

A build stays visible until it expires. Before, the distribution list and the build details also stopped at the Size Analysis retention. On the Team plan a build therefore disappeared after 30 days, although it is kept and can be installed for 13 months. The distribution list, its CSV export and the build details now show a build until date_expires, and leave its size analysis out of the response once date_size_analysis_expires has passed. The size and snapshot lists and the size analysis endpoints still stop at the Size Analysis retention. When this deploys, Team builds between 30 days and 13 months old come back in the distribution list, and the build details page shows its existing "No size analysis" state for them.

Rows without a date. For an artifact without a stamped date, the size analysis keeps the previous rule: the current retention, counted from date_added. The backfill sets date_added plus the current retention, which is the same instant, so the backfill does not change what can be read, whether it runs before or after this deploys.

Build Distribution had no retention check on read. Endpoints that load the artifact through PreprodArtifactEndpoint, which include the install details and the download, now return 404 once the artifact is past date_expires. On the Developer plan both retentions are 30 days, so date_expires is 30 days after the upload and these endpoints stop serving a build then. Endpoints that load artifacts in another way are not changed here: the snapshot endpoints, check-for-updates, the latest build, and the public install details and size analysis endpoints.

Refs EME-1314

Cross-repository landing order (top to bottom)

  • sentry#132001 — Read preprod retention through one helper, capped at 396 days
  • sentry#132002 — Add the expiry columns and stamp them when an artifact is created
  • getsentry#23481 — Add the job that backfills the expiry of existing artifacts
  • 👉 sentry#132003 — Read the expiry from the row, and keep a build visible until it expires
  • sentry#132004 — Delete artifacts in cleanup once they are past their stamped expiry
  • ops#25816 — Explain what --days still does on the preprod artifacts cleanup cron
  • sentry-docs#20923 — Add Build Distribution to the public data retention page

The builds list and the build details, size analysis download, comparisons, compare and compare download endpoints hid an artifact once it was older than the organization's current Size Analysis retention. A plan change therefore changed which existing builds could be read. They now compare the date_size_analysis_expires stamped on the artifact at creation.

An artifact without a stamped date keeps the previous behavior, so nothing appears or disappears while existing rows are being backfilled. The 90 day fallback for an unlimited retention is gone: such an artifact stays readable until cleanup deletes it by age.

Endpoints that load the artifact through PreprodArtifactEndpoint now also return 404 once it is past date_expires.

Refs EME-1314
@linear-code

linear-code Bot commented Nov 20, 2026

Copy link
Copy Markdown

EME-1314

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

decision-model-linter

api

src/sentry/preprod/api/bases/preprod_artifact_endpoint.py

  • warn makesExistingInputStricter = TRUE (0.83): Rejecting input an endpoint accepted before, or changing a field's default, breaks existing callers, and the API spec often doesn't show it. Make the change backward compatible (keep the field optional, accept the old values, or keep the old default), or treat it as a breaking change and coordinate it.

decision-model-linter: 49 calls on 10 files, 112,363 input tokens, $0.0047, model typesafe/jev-1.13-20260917

@sentry

sentry Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 1034 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

Merge the stamping change: an artifact without a stamped date is one that predates the columns, and it always falls back to the current retention counted from date_added, as before the columns existed.
A build was hidden from the distribution list and its details returned 404 once its size analysis expired, although the build is kept for the Build Distribution retention, which is longer on the Team plan. It could then only be reached through its install link.

The distribution list and the build details now show a build until date_expires and leave out its size analysis once that has expired. The size and snapshot lists and the size analysis endpoints still stop at the Size Analysis retention.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant