feat: setup logs retention by max file size

This commit is contained in:
fsylvain committed 2026-10-07 22:02:13 +02:00
1 parent 70c8492f4f
commit f914eae3c5
44 files changed
+2316 -161

No files matched your search

+9 -2
View File
@@ -30,7 +30,7 @@ Feature: The back-office keeps an append-only activity log that owners can read
| change.kind | text, body |
Scenario: The repository exposes no way to edit or delete one event
Then the audit Repository interface has exactly the methods Append, List, Summary and DeleteOlderThan
Then the audit Repository interface has exactly the methods Append, List, Summary, DeleteOlderThan, DeleteOldest and SizeBytes
And the persistence implementation exposes no other exported method than those and its constructor
And the HTTP surface has no POST, PUT, PATCH or DELETE under /v1/activity
@@ -464,7 +464,7 @@ Feature: The back-office keeps an append-only activity log that owners can read
| 2026-10-06T03:00:00 | 2026-10-06T04:00:00 | false |
| 2026-10-06T03:00:00 | 2026-10-07T03:00:00 | true |
Scenario: Forever never runs
Scenario: Forever with no size limit never runs
Given the retention is 0
When Tick runs at 2026-10-06T03:00:00
Then ran is false and DeleteOlderThan is not called
@@ -559,3 +559,10 @@ Feature: The back-office keeps an append-only activity log that owners can read
When the owner sends GET /v1/activity
Then the three events are listed newest first with their documented items
And GET /v1/activity?security=true lists only the failed login
Scenario: The size limit extension amends the retention rules
Given features/activity_home_card_and_retention.feature, rule "Retention size limit"
Then the settings default also has activity_retention_max_gb 0 and activity_log_size_bytes 0
And PATCH /v1/settings also accepts activity_retention_max_gb validated against audit.SizeOptions()
And the last 24 hours are never removed by DeleteOldest either
And a retention change is recorded with the max_gb_from and max_gb_to params when the size changes