Skip to content

Fix RSS/Atom feeds using static epoch for healthy checks#642

Merged
codingjoe merged 3 commits intomainfrom
copilot/fix-rss-feed-notification-bug
Feb 17, 2026
Merged

Fix RSS/Atom feeds using static epoch for healthy checks#642
codingjoe merged 3 commits intomainfrom
copilot/fix-rss-feed-notification-bug

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 17, 2026

  • Understand the current feed implementation
  • Implement fix to use epoch 0 for healthy checks and current timestamp for failed checks
  • Add/update tests to validate the fix (5 new tests added)
  • Run pre-commit hooks and tests (all 75 tests passing)
  • Address PR feedback on test assertions and optional dependencies
  • Request code review (no issues found)
  • Run security scan (no vulnerabilities detected)
Original prompt

This section details on the original issue you should resolve

<issue_title>🐛 Atom/RSS feeds constantly publish new items</issue_title>
<issue_description>### Bug Description

If you add the atom or RSS feeds to a reader, it will constantly notify you about new items.

The main reason is using _render_feed using timezone.now().

Expected Behavior

Since health checks are not stateful, we could simply hardcode the date. E.G. if the check is healthy, just return epoch 0. If a check fails, use the current timestamp. This way we only spam RSS readers if there is an error.

But we'd need to evaluate this further and verify the solution.

Version

4.0.0

Stack trace

No response

Steps to Reproduce

Adding the feed to Slack will have the bot post all checks into the channel every minute.</issue_description>

<agent_instructions>Deliberate a solution and explain your reasoning in the PR description.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Custom agent used: SuperJoe
CodingJoe's digital clone following his coding guidelines and best practices.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

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>
Copilot AI changed the title [WIP] Fix RSS feeds to reduce unnecessary notifications Fix RSS/Atom feeds using static epoch for healthy checks Feb 17, 2026
Copilot AI requested a review from codingjoe February 17, 2026 13:00
Copy link
Copy Markdown
Owner

@codingjoe codingjoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of comments use proper assertion messages in tests where they add value.

Comment thread tests/test_views.py Outdated
@codingjoe
Copy link
Copy Markdown
Owner

@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>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 17, 2026

Instead of comments use proper assertion messages in tests where they add value.

Done in 1e3651a - replaced comments with assertion messages that provide context about expected behavior.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2be5503) to head (1e3651a).
⚠️ Report is 1 commits behind head on main.

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     
Flag Coverage Δ
python-3.10-django-5.2 58.11% <100.00%> (+0.12%) ⬆️
python-3.11-django-5.2 58.11% <100.00%> (+0.12%) ⬆️
python-3.12-django-5.2 52.14% <100.00%> (+0.13%) ⬆️
python-3.12-django-6.0 52.14% <100.00%> (+0.13%) ⬆️
python-3.13-django-5.2 52.14% <100.00%> (+0.13%) ⬆️
python-3.13-django-5.2-celery 57.42% <100.00%> (+0.11%) ⬆️
python-3.13-django-5.2-kafka 55.33% <100.00%> (+0.12%) ⬆️
python-3.13-django-5.2-psutil 64.35% <100.00%> (+0.09%) ⬆️
python-3.13-django-5.2-rabbitmq 55.06% <100.00%> (+0.12%) ⬆️
python-3.13-django-5.2-redis 54.92% <100.00%> (+0.12%) ⬆️
python-3.13-django-5.2-rss 73.23% <100.00%> (+0.07%) ⬆️
python-3.13-django-6.0 52.14% <100.00%> (+0.13%) ⬆️
python-3.14-django-5.2 52.44% <100.00%> (+0.13%) ⬆️
python-3.14-django-6.0 52.44% <100.00%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codingjoe codingjoe marked this pull request as ready for review February 17, 2026 14:10
Copilot AI review requested due to automatic review settings February 17, 2026 14:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@codingjoe codingjoe merged commit bc54f69 into main Feb 17, 2026
31 checks passed
@codingjoe codingjoe deleted the copilot/fix-rss-feed-notification-bug branch February 17, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Atom/RSS feeds constantly publish new items

3 participants