fix(attachments): Delete based on date_expires in cleanup job#111955
Open
matt-codecov wants to merge 4 commits intomasterfrom
Open
fix(attachments): Delete based on date_expires in cleanup job#111955matt-codecov wants to merge 4 commits intomasterfrom
matt-codecov wants to merge 4 commits intomasterfrom
Conversation
jan-auer
approved these changes
Apr 1, 2026
Member
|
Looks good for production. I also checked self-hosted and there's a single
|
…ariable-expiry * origin/master: (96 commits) ref: update TanStack Query (#111884) feat(stacktrace): Add frontend hook and UI for on-demand SCM source context (#110327) ref(dynamic-sampling): remove all usage of custom ds rules in code (v2) (#111982) Remove experimental from logs (#112088) feat(onboarding): Add Litestar as a Python onboarding platform (FE) (#111607) ref(snapshots): Add skill and add InputGroup snapshot tests to test skill (#112074) fix(explorer): use issue.id filter for event timeseries (#112078) fix(preprod): Speed up error page on snapshots and improve error UI (#112076) chore(ACI): Add example data to payload for GitHub action in workflow creation (#112068) chore: Re-run `codeowners-coverage baseline` to trim output (#112062) fix(issues): Redesign new stack trace grid (#112059) feat(aci): Add types for DetectorInput and DataSourceInput (#112050) chore(ACI): Add a single feature flag to control issue alert rule backwards compatible endpoint flags (#112063) fix(ui): Increase node memory limit locally, decrease ci (#112066) feat(preprod): Add snapshot approval UI in header (#111977) ref(github): Do not return sentinel install option via API (#112038) feat(preprod): Add approval API endpoint and approval info in snapshot response (#111976) feat(coding integrations): add github copilot as an integration (frontend) (#111851) fix(grouping): Fix IPv6 parameterization (#111979) feat(autofix): Add seerDrawer to location (#112048) ...
Self-hosted runs a single cleanup job with a fixed --days value. Since EventAttachment now deletes based on date_expires, using --days=30 would delay deletion by 30 days past the attachment's expiry, effectively doubling storage duration for plans with matching retention periods. Introduce models_which_use_expiry_deletions() for models with per-record expiry dates, and run that path with days=0 unconditionally alongside the existing age-based path. No operator config changes needed.
jan-auer
requested changes
Apr 2, 2026
Member
There was a problem hiding this comment.
Good to go.
Blocking merge until backfill is complete. See #112095 (comment)
…piry test Match the existing pattern used in other cleanup tests that pass SynchronousTaskQueue to functions expecting _WorkQueue.
223ecdb to
e4c2fa6
Compare
Member
|
This PR can be merged on or after Apr 30, 20:00 UTC |
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.
Depends on #111881 + #111980.
Attachments now store a per-record
date_expiresset by the application based on the organization's plan retention. The cleanup job previously deleted based ondate_added, so this PR switches todate_expires.Self-hosted problem: Self-hosted typically runs one cleanup job with a fixed
--days=N. Withdate_expiresas the cutoff field, the query becomesdate_expires < now() - N days, which delays deletion by N days past expiry. For a 90-day plan with--days=90, attachments would live for 180 days — twice as long as intended.Fix: Introduce a separate
models_which_use_expiry_deletions()code path that always runs withdays=0, independent of--days. It runs alongside the existing age-based path. No operator config changes needed — the job keeps running as-is and attachments are now deleted exactly when theirdate_expiresis reached.Closes FS-328