Add persistent system notifications with entity table backend#25873
Open
patrickmann wants to merge 5 commits intomasterfrom
Open
Add persistent system notifications with entity table backend#25873patrickmann wants to merge 5 commits intomasterfrom
patrickmann wants to merge 5 commits intomasterfrom
Conversation
Replace the ephemeral notification system with a persistent model backed by a new `system_notifications` MongoDB collection. Notifications now have read/unread state with actor tracking, a paginated entity table API, configurable retention with a cleanup periodical, and an audit trail. Key changes: - New SystemNotificationDto, SystemNotificationService, and NotificationServiceAdapter that implements the existing NotificationService interface as a facade - Paginated GET endpoint, toggle-read, bulk toggle, read-all, retention config endpoints, and ID-based HTML render endpoint - SystemNotificationCleanupPeriodical for age-based and safety-cap retention - Migration from old `notifications` collection - Remove extends Persisted/PersistedService from Notification interfaces - Delete NotificationImpl and NotificationServiceImpl Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use AutoValue builder instead of private generated constructor for Actor - Migrate to org.graylog2.database.MongoCollection wrapper - Wrap MongoUtils.stream() calls in try-with-resources - Replace unsupported $ne:null with $type:"string" in partial index filter - Replace removed NotificationService.destroy() with fixed() - Make RenderResponse a static inner class Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/nocl new feature
/prd Graylog2/graylog-plugin-enterprise#14135
References #25789
Refer to the spec for design details.
Summary
NotificationImpl/NotificationServiceImplwith MongoDB-backedSystemNotificationDto/SystemNotificationServiceNotificationServiceAdapterto preserve the legacyNotificationServiceAPI while delegating to the new serviceNotificationsResourcewith paginated list, read/unread toggling, and bulk operationsSystemNotificationCleanupPeriodicalfor retention (age-based and count-based)notificationscollection to newsystem_notificationscollectionHow tested
The new paginated endpoint and history feature require a corresponding entity table UI for testing.
Back-compat of legacy endpoints:
Unit tests:
SystemNotificationServiceTest-- publish, dedup, mark read/unread, toggle, pagination, retentionNotificationServiceAdapterTest-- adapter delegates correctly to new serviceSystemNotificationCleanupPeriodicalTest-- retention cleanup logicDeletedStreamNotificationListenerTest-- stream deletion resolves notificationsSystemNotificationRenderServiceTest-- render service unchanged