Repository navigation
Conversation
Add date_expires and date_size_analysis_expires to PreprodArtifact and set them at the two places that create one, from the retention of the organization at that time. Nothing reads the columns yet. A build is analyzed for size and distributed from the same row, and the two can have different retentions, so the row carries two dates: date_expires at the longest retention, for the row and its files, and date_size_analysis_expires at the Size Analysis retention. The index on date_expires is in its own post-deployment migration. Refs EME-1314
This was referenced Nov 20, 2026
Merge the retention helper change: there is no unlimited retention any more, so an artifact always gets both dates when it is created. A null date now only means the row predates the columns.
Contributor
|
This PR has a migration; here is the generated SQL for for --
-- Add field date_expires to preprodartifact
--
ALTER TABLE "sentry_preprodartifact" ADD COLUMN "date_expires" timestamp with time zone NULL;
--
-- Add field date_size_analysis_expires to preprodartifact
--
ALTER TABLE "sentry_preprodartifact" ADD COLUMN "date_size_analysis_expires" timestamp with time zone NULL; |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sentry documents that retention is set when data is ingested, but a preprod build has no retention recorded on it: reads derive it from the current plan and deletion uses a fixed age. Each
PreprodArtifactnow gets its expiry stamped when it is created, from the retention the organization has at that time.Two products on one row. A build is analyzed for size and distributed from one row and one set of files, and the two retentions differ on the Team plan and on trials (30 days and 396 days). The row therefore carries two dates.
date_expiresuses the longest retention and is when the row and its files are deleted.date_size_analysis_expiresuses the Size Analysis retention and is when the size analysis stops being readable. This keeps what both products do today: size analysis is readable for 30 days there, and the build stays installable for 13 months. On the Developer plan, which has no Build Distribution, both retentions are 30 days, so both dates are 30 days after the upload. Both periods are the product's: the retention table on EME-239 gives Size Analysis 30 days on Developer and Team and Build Distribution 13 months on Team, and EME-724 decided to keep the data for 13 months and to limit by plan what is shown. One date at the longer retention would make size analysis readable for 13 months, and one date at the shorter retention would delete builds that are still distributed. The size analysis rows and files are still deleted together with the artifact, not at the shorter date.Snapshots have no data category yet (EME-1315), so a snapshot artifact gets the same two dates as a build. That keeps its lifetime as it is today.
Every new artifact gets both dates. An instance without a configured retention uses the default of 90 days, so a null date only means that the row was created before the columns existed. The later PRs give such a row the behavior it has today.
Nothing reads the columns yet. The column migration runs with the deploy, because the new code writes the columns. The index on
date_expiresis a separate post-deployment migration.Refs EME-1314
Cross-repository landing order (top to bottom)
cleanuponce they are past their stamped expiry--daysstill does on the preprod artifacts cleanup cron