Skip to content

feat(uptime): Add UptimeResponseCapture to cleanup infrastructure#107079

Merged
wedamija merged 2 commits intomasterfrom
danf/uptime-deletions
Jan 28, 2026
Merged

feat(uptime): Add UptimeResponseCapture to cleanup infrastructure#107079
wedamija merged 2 commits intomasterfrom
danf/uptime-deletions

Conversation

@wedamija
Copy link
Member

Register UptimeResponseCapture with the deletions framework so that old response captures are cleaned up. Uses ModelDeletionTask to ensure the custom delete() method is called, which properly removes the associated File and its storage blobs.

Also adds an index on date_added for cleanup queries.

Register UptimeResponseCapture with the deletions framework so that old response captures are cleaned up. Uses ModelDeletionTask to ensure the custom delete() method is called, which properly removes the associated File and its storage blobs.

Also adds an index on date_added for cleanup queries.
@wedamija wedamija requested review from a team as code owners January 27, 2026 18:55
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 27, 2026
@github-actions
Copy link
Contributor

This PR has a migration; here is the generated SQL for src/sentry/uptime/migrations/0052_add_date_added_index_to_uptimeresponsecapture.py

for 0052_add_date_added_index_to_uptimeresponsecapture in uptime

--
-- Create index uptime_upti_date_ad_d591fd_idx on field(s) date_added of model uptimeresponsecapture
--
CREATE INDEX CONCURRENTLY "uptime_upti_date_ad_d591fd_idx" ON "uptime_uptimeresponsecapture" ("date_added");

Copy link
Contributor

@cursor cursor bot left a comment

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.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

url="https://example.com",
interval_seconds=60,
timeout_ms=5000,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Test bypasses established fixture pattern for consistency

Low Severity

The test creates an UptimeSubscription directly via UptimeSubscription.objects.create() instead of using the available self.create_uptime_subscription() fixture method. Other tests in the same file follow the fixture pattern (e.g., self.create_project(), self.create_group()). Using the fixture would be consistent with the codebase's test patterns and provide default values, making the test more maintainable if the model's required fields change.

Fix in Cursor Fix in Web

@wedamija wedamija merged commit 3fa6d16 into master Jan 28, 2026
66 of 67 checks passed
@wedamija wedamija deleted the danf/uptime-deletions branch January 28, 2026 22:42
priscilawebdev pushed a commit that referenced this pull request Feb 2, 2026
…07079)

Register UptimeResponseCapture with the deletions framework so that old
response captures are cleaned up. Uses ModelDeletionTask to ensure the
custom delete() method is called, which properly removes the associated
File and its storage blobs.

Also adds an index on date_added for cleanup queries.

<!-- Describe your PR here. -->
@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants