feat: clean up old notifications

a new scheduled task that will delete old notifications. the default is
that over 1 year old notifications will be deleted. the scheduled task
is run every 24 hours. this can be disabled by setting the
retention period to false in the notifications config.

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
This commit is contained in:
Hellgren Heikki
2025-06-11 14:10:35 +03:00
parent 2071dd40cf
commit 41d4d6e7af
11 changed files with 320 additions and 10 deletions
+15
View File
@@ -158,6 +158,21 @@ You can customize the origin names shown in the UI by passing an object where th
Each notification processor will receive its own row in the settings page, where the user can enable or disable notifications from that processor.
### Automatic notification cleanup
Notifications are deleted automatically after a certain period of time to prevent the database from growing indefinitely
and to keep the user interface clean. The default retention period is set to 1 year, meaning that notifications older
than that will be deleted automatically.
The retention period can be configured by setting the `notifications.retention` in the `app-config.yaml` file.
```yaml
notifications:
retention: 1y
```
If the retention is set to false, notifications will not be automatically deleted.
## Additional info
An example of a backend plugin sending notifications can be found in the [`@backstage/plugin-scaffolder-backend-module-notifications` package](https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend-module-notifications).