Skip to content

feat(retention): data retention - #359

Open
vm-001 wants to merge 2 commits into
mainfrom
feat/retention
Open

feat(retention): data retention#359
vm-001 wants to merge 2 commits into
mainfrom
feat/retention

Conversation

@vm-001

@vm-001 vm-001 commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR introduces configurable data retention to periodically purge expired objects(events, attempts) from the database, keeping storage usage bounded and preventing historical records from degrading query performance over time.

Note:

  • Retention only runs on standalone and control-plane nodes. (ignored in data-plane nodes)
  • No delete cascade on attempts table.

Configuration

#retention:
#  enabled: true                               # Whether to enable data retention. Defaults to false.
#  events: 30                                  # Retention period (in days) for events. Set to 0 to disable event cleanup.
#  attempts: 60                                # Retention period (in days) for delivery attempts. Set to 0 to disable attempt cleanup.

@vm-001
vm-001 marked this pull request as draft August 2, 2026 16:36
@codecov

codecov Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.09677% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
services/retention/retention.go 85.18% 8 Missing and 4 partials ⚠️
app/app.go 81.81% 1 Missing and 1 partial ⚠️
config/config.go 50.00% 1 Missing and 1 partial ⚠️
db/dao/attempt_dao.go 85.71% 1 Missing and 1 partial ⚠️
db/dao/event_dao.go 85.71% 1 Missing and 1 partial ⚠️
Flag Coverage Δ
integration 76.44% <74.83%> (-0.04%) ⬇️
integration-o11 38.74% <18.06%> (-0.46%) ⬇️
unit 16.81% <18.70%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
config/modules/retention.go 100.00% <100.00%> (ø)
utils/fmt.go 100.00% <100.00%> (ø)
app/app.go 82.38% <81.81%> (-0.07%) ⬇️
config/config.go 50.87% <50.00%> (-0.07%) ⬇️
db/dao/attempt_dao.go 97.40% <85.71%> (-2.60%) ⬇️
db/dao/event_dao.go 88.67% <85.71%> (-1.07%) ⬇️
services/retention/retention.go 85.18% <85.18%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vm-001
vm-001 requested a review from webhookx-x August 4, 2026 08:35
@vm-001
vm-001 marked this pull request as ready for review August 4, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants