Skip to content

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

Draft
trevor-e wants to merge 2 commits into
masterfrom
telkins/seer-run-deletion-task
Draft

feat(seer): Add SeerRun retention cleanup via incinerator#118606
trevor-e wants to merge 2 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.

The getsentry-incinerator-seer-runs CronJob ships separately in the ops repo.

Test plan

  • pytest tests/sentry/runner/commands/test_cleanup.py

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.
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