Unify SNS failure-alarm formatting across modules#8
Merged
Conversation
Add paper_bridge/shared/notifications.format_alarm() so every operational alarm renders in one consistent shape — "[project] Event — STATUS" subject, aligned Key: Value body, UTC timestamp footer — and route the indexer, cleaner, and summarizer failure notifications through it instead of each hand-assembling its own message string. The indexer/summarizer now omit the "Paper IDs" row when no ids are present rather than emitting an empty list. Also add a PR template and unit tests for the formatter.
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.
Summary
Centralizes operational SNS alarm formatting so every failure notification (indexer, cleaner, summarizer) renders in one consistent shape instead of each module hand-assembling its own message string.
Changes
paper_bridge/shared/notifications.format_alarm()— builds a(subject, message)pair:[project] Event — STATUSsubject, alignedKey: Valuebody (multi-line values render as a block), UTC timestamp footer.format_alarmfrompaper_bridge.shared.send_failure_notificationin the indexer, cleaner, and summarizer throughformat_alarm..github/PULL_REQUEST_TEMPLATE.md.Testing
pytest tests/test_shared_notifications.py— 6 passed; affected module suites green locallyNotes
The unified shape is intended to match the sibling projects (omnisummary, tech-digest, scholar-lens) so an operator scanning a mailbox can parse any alarm at a glance.