Skip to content

feat(preprod): Read retention through one helper capped at 396 days - #132001

Draft
lcian wants to merge 2 commits into
masterfrom
lcian/feat/preprod-retention-helper
Draft

lcian wants to merge 2 commits into
masterfrom
lcian/feat/preprod-retention-helper

Conversation

@lcian

@lcian lcian commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

The retention of Size Analysis and Build Distribution data is read from the quotas backend in five places, each with its own fallback of 90 days for an unlimited retention. They now read it through sentry.preprod.retention, which holds that default once and is also where the later PRs in this stack compute an artifact's expiry.

The helper cuts a retention to 396 days, in MAX_RETENTION_DAYS. Retention overrides have no upper bound, but rows are already deleted at 396 days and the Objectstore use case configuration for preprod rejects a longer TTL with a 400, so a longer override could never be honored. The retention endpoint that Launchpad reads for the TTL of app icons now returns at most 396 for the same reason. Launchpad itself needs no change.

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

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.

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