Skip to content

feat(seer): Add SeerRun retention cleanup via incinerator - #118606

Merged
trevor-e merged 5 commits into
masterfrom
telkins/seer-run-deletion-task
Jul 23, 2026
Merged

feat(seer): Add SeerRun retention cleanup via incinerator#118606
trevor-e merged 5 commits into
masterfrom
telkins/seer-run-deletion-task

Conversation

@trevor-e

@trevor-e trevor-e commented Jun 26, 2026

Copy link
Copy Markdown
Member

Adds 30-day retention cleanup for SeerRun, matching Seer's existing run_state TTL. Nothing aged these rows out before (org deletion cascades, but there was no TTL sweep).

Implemented via the incinerator (sentry cleanup):

  • Add SeerRun to models_which_use_deletions_code_path() so sentry cleanup --model=SeerRun --days=30 deletes old runs through the deletions framework.
  • Register SeerRun with ModelDeletionTask. Cascades to SeerRunPullRequest and SeerAgentRun; Night Shift links are SET_NULL and survive, will be handled separately in follow-up.

Will add the ops change afterwards.

Register SeerRun in the deletions code path so the `sentry cleanup`
command can age out old runs, matching Seer's 30-day run_state TTL.
Deletion cascades to SeerRunPullRequest and SeerAgentRun; Night Shift
links are SET_NULL and survive.

The accompanying getsentry-incinerator CronJob (--model=SeerRun
--days=30) lives in the ops repo and ships separately.
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 26, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a7a87dd. Configure here.

Comment thread src/sentry/runner/commands/cleanup.py
SeerRun is organization-scoped and has no project_id, so the --project
cleanup path would error filtering on a nonexistent column and silently
skip SeerRun retention. Drop it from the deletes list in
remove_cross_project_models, alongside the other cross-project models.
@getsantry

getsantry Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label Jul 18, 2026
@trevor-e trevor-e added WIP and removed Stale labels Jul 20, 2026
trevor-e added 2 commits July 23, 2026 15:19
SeerNightShiftRunResult.result_seer_run and SeerNightShiftRunShard.seer_run are SET_NULL rather than CASCADE, so their rows should outlive the SeerRun cleanup with a nulled pointer.
@trevor-e
trevor-e marked this pull request as ready for review July 23, 2026 20:08
@trevor-e
trevor-e requested a review from a team as a code owner July 23, 2026 20:08
@trevor-e
trevor-e merged commit 31d43de into master Jul 23, 2026
63 of 64 checks passed
@trevor-e
trevor-e deleted the telkins/seer-run-deletion-task branch July 23, 2026 21:17
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 WIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants