Skip to content

Fix RSS pubDate missing (Closes #164)

James Montgomery requested to merge monty/debexpo:fix/rss_time into live

Description

This merge request addresses issue #164 (closed) by adding pubDate to individual RSS feed items in the PackagesFeed class. This change ensures that each RSS item has an accurate publication date, resolving the problem where missing pubDate values were being interpreted as the epoch date by some RSS readers.

Changes Made

  1. Views Update:

    • Added the item_pubdate method to the PackagesFeed class in debexpo/packages/views.py to include the publication date for each RSS feed item.
    • Updated the item_pubdate method to fetch the latest upload date of each package and use it as the pubDate.
  2. Functional Tests:

    • Added a new test test_feed_item_pubdate in tests/functional/packages/test_packages.py to assert that the pubDate of an RSS item matches the latest upload date of the package.
  3. Unit Tests:

    • Added a new test test_feed_item_pubdate in tests/unit/packages/test_packages.py to verify that the pubDate is correctly formatted and returned.

Testing

All changes have been tested using tox to ensure they work as expected. The specific new tests added for this feature confirm that the pubDate is now present and correctly formatted in the RSS feed items.

Acknowledgment

I would like to thank @lyknode for calling to my attention in his response to @kathenas that my previous response already contained the necessary pubDate changes, I just needed to remove logging and write tests 😀

Merge request reports

Loading