fix(rss): convert Atom feeds without entries - #2478
Open
RKS (rksharma-owg) wants to merge 1 commit into
Open
Conversation
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.
A namespace-qualified Atom feed with no entries currently fails
RssConverter.convert()withValueError: Unknown feed type. ThroughMarkItDown.convert_stream(), it falls back to raw XML instead of rendering the feed title and subtitle. RFC 4287 section 4.1.1 permits zero entry elements.The detection code incorrectly requires an entry even when the root declares the Atom namespace. Accept that namespace-qualified root without entries, while preserving the existing entry heuristic for unqualified feeds. For example, an empty release feed now produces
# Release updatesand its subtitle,No releases yet.Regression tests cover default and explicit namespace prefixes, extension and MIME detection, stream-position preservation, direct conversion, and the public API. Negative cases retain rejection of entryless unqualified or unrelated-namespace XML. The README notes support for Atom feeds without entries. No related issue was found in the issue and PR searches.
Validation on macOS / Python 3.12.13:
pytest tests/test_rss_converter.py tests/test_rss_titles.py -q).hatch test --python 3.12, withGITHUB_ACTIONS=trueandOPENAI_API_KEYunset to use the existing remote/LLM skip conditions).pre-commit run --all-files: passed.hatch build -t wheel: passed.git diff --check: passed.The patch and tests were prepared with assistance from OpenAI Codex.