Skip to content

Commit bde080d

Browse files
committed
ref(preprod): Explain how reads treat snapshots without a size analysis date
1 parent e19e66f commit bde080d

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎src/sentry/preprod/builds_query.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ def filtered_builds_queryset(
3939
queryset = queryset.filter(unexpired_artifacts())
4040
# A build is listed for distribution until it expires. That can be after its size
4141
# analysis has expired, where Build Distribution has the longer retention. Every
42-
# other display is about the size analysis, or about snapshots, which follow the
43-
# Size Analysis retention until they have their own.
42+
# other display is about the size analysis, or about snapshots. A snapshot has no
43+
# `date_size_analysis_expires`, so it keeps the previous rule here: the Size Analysis
44+
# retention, counted from `date_added`.
4445
if display != "distribution":
4546
queryset = queryset.filter(unexpired_size_analysis(organization))
4647
if start:

‎src/sentry/preprod/retention.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ def is_size_analysis_expired(artifact: PreprodArtifact, organization: Organizati
137137
served.
138138
139139
This is decided by the date stamped on the artifact when it was created. An
140-
artifact without one (created before the column existed and not backfilled yet)
141-
falls back to what applied before the column existed: the organization's current
142-
retention, counted from `date_added`.
140+
artifact without one falls back to what applied before the column existed: the
141+
organization's current retention, counted from `date_added`. That is a build created
142+
before the column existed and not backfilled yet, or a snapshot, which never has one.
143143
"""
144144
now = timezone.now()
145145
if artifact.date_size_analysis_expires is not None:

0 commit comments

Comments
 (0)