Skip to content

feat(preprod): Read retention through a shared helper - #132001

Merged
lcian merged 6 commits into
masterfrom
lcian/feat/preprod-retention-helper
Nov 26, 2026
Merged

lcian merged 6 commits into
masterfrom
lcian/feat/preprod-retention-helper

Conversation

@lcian

@lcian lcian commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Preprod code reads retention from the quotas backend in five places, and an override above 396 days gives Launchpad an app icon TTL that Objectstore rejects. These places now use one helper in sentry.preprod.retention, which defaults to 90 days and cuts longer retentions to 396 days.

Rows are already deleted at 396 days, so a longer override could never be honored. A cut retention is logged as preprod.retention.exceeds_max instead of failing ingestion, because the customer cannot fix the override.

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 retention of Size Analysis and Build Distribution data was read from the quotas backend in five places, each with its own fallback of 90 days for an unlimited retention. They now go through sentry.preprod.retention.

The helper also cuts a retention to 396 days. Rows are already deleted at 396 days, and the Objectstore use case configuration for preprod rejects a longer TTL, so an override above that could never be honored.

Refs EME-1314
@linear-code

linear-code Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

EME-1314

FS-653

get_retention_days returned None for an unlimited retention, and callers that need a number had a second helper for it. An instance without a configured retention now gets the default of 90 days everywhere, so there is one helper and it always returns a number.
A retention override longer than MAX_RETENTION_DAYS can't be honored, so it is still cut to the maximum, but now it is logged as an error so the override or the maximum can be fixed.
Comment thread src/sentry/preprod/retention.py Resolved
@lcian lcian changed the title feat(preprod): Read retention through one helper capped at 396 days feat(preprod): Read retention through a shared helpers Nov 26, 2026
@lcian lcian changed the title feat(preprod): Read retention through a shared helpers feat(preprod): Read retention through a shared helper Nov 26, 2026
@lcian
lcian marked this pull request as ready for review November 26, 2026 14:38
@lcian
lcian requested a review from a team as a code owner November 26, 2026 14:38
@lcian
lcian merged commit 89cfa7d into master Nov 26, 2026
87 checks passed
@lcian
lcian deleted the lcian/feat/preprod-retention-helper branch November 26, 2026 14:39

This branch was successfully deployed

1 active deployment
Preview — 2c0c68e6 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