Skip to content

feat(preprod): Delete artifacts when they expire - #132004

Draft
lcian wants to merge 1 commit into
lcian/feat/preprod-expiry-readsfrom
lcian/feat/preprod-expiry-cleanup
Draft

lcian wants to merge 1 commit into
lcian/feat/preprod-expiry-readsfrom
lcian/feat/preprod-expiry-cleanup

Conversation

@lcian

@lcian lcian commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

cleanup deletes every preprod artifact at the cron's fixed --days (396 on multi-tenant cells, 90 on single-tenant cells), whatever its retention. It now deletes an artifact once it is past its stamped date_expires.

Snapshots are deleted at their date_expires, which follows the Size Analysis retention as a stand-in for the snapshot retention (EME-1316). On the Developer and Team plans that is 30 days after the upload instead of 396, and the first run after the backfill deletes the older ones too. Developer plan builds are now deleted after 30 days instead of 396, and the first run after the backfill deletes the existing ones that are older (nobody has counted how many). Single-tenant cells keep builds for their retention instead of 90 days. Rows without a date are still deleted at --days, so this is safe to deploy before the backfill finishes. Deletion now also removes a snapshot's manifests, comparisons and diff masks from Objectstore, but not its images, which are shared and expire on their own. It also removes the artifact's trace items from EAP, which adds one EAP delete request per project to each chunk of 100 artifacts.

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
  • sentry#132702 — Add the index on date_expires that the cleanup reads, as a post-deployment migration
  • 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

@linear-code

linear-code Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

EME-1314

FS-653

@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 1084 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

@NicoHinderling

Copy link
Copy Markdown
Contributor

similarly #132003 (comment)

@lcian
lcian force-pushed the lcian/feat/preprod-expiry-cleanup branch from 7568003 to e7daef6 Compare November 26, 2026 14:42
@lcian
lcian force-pushed the lcian/feat/preprod-expiry-reads branch from a2d7a15 to 4c49cd4 Compare November 26, 2026 14:42
@lcian
lcian force-pushed the lcian/feat/preprod-expiry-cleanup branch from e7daef6 to 43b5609 Compare November 26, 2026 15:37
@lcian
lcian force-pushed the lcian/feat/preprod-expiry-reads branch 2 times, most recently from 03034dd to d449216 Compare November 26, 2026 16:10
@lcian
lcian force-pushed the lcian/feat/preprod-expiry-cleanup branch from 43b5609 to 4f53ee1 Compare November 26, 2026 16:10
@lcian
lcian force-pushed the lcian/feat/preprod-expiry-cleanup branch from 4f53ee1 to 0ab63e7 Compare November 26, 2026 20:24
@lcian
lcian force-pushed the lcian/feat/preprod-expiry-reads branch from d449216 to bde080d Compare November 26, 2026 20:24

This branch was successfully deployed

1 active (outdated) deployment
Preview — 7568003a Deployed Nov 26, 2026 by vercel[bot]
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.

2 participants