Fix RSS/Atom feeds using static epoch for healthy checks#642
Conversation
This change prevents RSS/Atom feed readers from being constantly notified about health check updates. Now: - Healthy checks use epoch (1970-01-01) as their published/updated date - Failed checks use the current timestamp This ensures feed readers only get notifications when actual errors occur, not on every health check poll. Co-authored-by: codingjoe <1772890+codingjoe@users.noreply.github.com>
codingjoe
left a comment
There was a problem hiding this comment.
Instead of comments use proper assertion messages in tests where they add value.
|
@copilot ^^ |
- Replace `import feedparser` with `pytest.importorskip("feedparser")` for optional dependency handling
- Replace code comments with proper assertion messages that add value
- Remove obvious comments that don't add context
Co-authored-by: codingjoe <1772890+codingjoe@users.noreply.github.com>
Done in 1e3651a - replaced comments with assertion messages that provide context about expected behavior. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #642 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 13 13
Lines 719 721 +2
=========================================
+ Hits 719 721 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where RSS/Atom feeds constantly publish new items, causing spam notifications in feed readers. The solution uses a static epoch timestamp (1970-01-01) for healthy checks and the current timestamp only for failed checks.
Changes:
- Modified feed generation to conditionally set timestamps based on check status
- Added comprehensive tests covering healthy, error, and mixed check scenarios for both Atom and RSS feeds
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| health_check/views.py | Implemented conditional timestamp logic in _render_feed method to use epoch for healthy checks and current time for errors |
| tests/test_views.py | Added 5 new test cases validating epoch usage for healthy checks, current timestamps for errors, and mixed scenarios for both Atom and RSS feeds |
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.