Skip to content

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Dec 28, 2025

Summary

This PR completes all missing namespace functionality for feedparser-rs across three phases:

Phase 1: Podcast 2.0 + iTunes ✅

  • Add PodcastChapters type for podcast:chapters element
  • Add PodcastSoundbite type for podcast:soundbite element
  • Add PodcastEntryMeta container for entry-level podcast metadata
  • Add itunes:complete and itunes:new-feed-url fields to ItunesFeedMeta
  • Add DoS limits: max_podcast_transcripts, max_podcast_funding, max_podcast_persons, max_podcast_soundbites
  • Add SSRF security warnings to all URL fields
  • Optimize parse_duration() and parse_explicit() to avoid allocations

Phase 2: Media RSS + podcast:value ✅

  • Add MediaContent with full Media RSS spec (medium, bitrate, framerate, expression, isDefault)
  • Add MediaThumbnail with NTP time offset support
  • Add PodcastValue and PodcastValueRecipient for value-for-value monetization
  • Implement podcast:value parsing with nested valueRecipient elements
  • Add max_value_recipients DoS limit (default: 20)
  • Add media_content_to_enclosure() conversion helper

Phase 3: Compat Module + GeoRSS ✅

  • Add compat module with Python feedparser compatibility helpers:
    • normalize_version() converts FeedVersion to Python format
    • format_duration() converts seconds to HH:MM:SS
    • is_valid_version() validates version identifiers
  • Add geo field to FeedMeta for feed-level geographic data
  • Add GeoRSS parsing at channel level in RSS and RSS 1.0 parsers

Breaking Changes

  • Entry struct now has podcast: Option<PodcastEntryMeta> field

Quality Assurance

All three phases passed:

  • ✅ Performance review (rust-performance-engineer)
  • ✅ Security audit (rust-security-maintenance)
  • ✅ Testing review (rust-testing-engineer)
  • ✅ Code review (rust-code-reviewer)

Test Results

  • ✅ 574 tests pass
  • ✅ Clippy passes with no warnings
  • ✅ Code formatted with cargo +nightly fmt
  • ✅ Test coverage >85% for new code

Files Changed

  • Types: podcast.rs, feed.rs, entry.rs, common.rs, mod.rs
  • Parsers: rss.rs, rss10.rs, common.rs
  • Namespaces: media_rss.rs, georss.rs
  • New: compat/mod.rs
  • Limits: limits.rs (core + py bindings)
  • Tests: test_podcast_namespace.rs + inline tests

…te/new-feed-url

Phase 1 of namespace completion:

- Add PodcastChapters type for podcast:chapters element
- Add PodcastSoundbite type for podcast:soundbite element
- Add PodcastEntryMeta container for entry-level podcast metadata
- Add itunes:complete and itunes:new-feed-url fields to ItunesFeedMeta
- Add DoS limits: max_podcast_transcripts, max_podcast_funding, max_podcast_persons
- Add SSRF security warnings to all URL fields in podcast types
- Optimize parse_duration() and parse_explicit() to avoid allocations
- Add comprehensive tests for new functionality

BREAKING: Entry struct now has `podcast: Option<PodcastEntryMeta>` field
@github-actions github-actions bot added type: tooling Development tools, CI/CD, or infrastructure component: core feedparser-rs-core Rust library component: python Python bindings (PyO3) component: node Node.js bindings (napi-rs) component: tests Test suite or test infrastructure area: parser Feed parsing logic area: rss RSS 0.9x, 1.0, 2.0 support lang: rust Rust code size: XL Extra large PR (<1000 lines changed) labels Dec 28, 2025
Phase 2 of namespace completion:

- Add MediaContent type with full Media RSS spec (medium, bitrate, framerate, expression, isDefault)
- Add MediaThumbnail type with NTP time offset support
- Add PodcastValue and PodcastValueRecipient types for value-for-value monetization
- Implement podcast:value parsing with nested valueRecipient elements
- Add max_value_recipients DoS limit (default: 20)
- Add SSRF security warnings to MediaContent.url and MediaThumbnail.url
- Add media_content_to_enclosure() conversion helper
- Add comprehensive unit tests for all new types
@github-actions github-actions bot added size: XXL Huge PR (1000+ lines changed) and removed size: XL Extra large PR (<1000 lines changed) labels Dec 28, 2025
Phase 3 (final) of namespace completion:

- Add compat module with Python feedparser compatibility helpers:
  - normalize_version() converts FeedVersion to Python format
  - format_duration() converts seconds to HH:MM:SS
  - is_valid_version() validates version identifiers
- Add geo field to FeedMeta for feed-level geographic data
- Add handle_feed_element() to GeoRSS namespace handler
- Add is_georss_tag() helper to parser common module
- Integrate GeoRSS parsing at channel level in RSS and RSS 1.0 parsers
- Add comprehensive tests for all new functionality
- Add #![allow(missing_docs)] to test file
- Fix clippy warnings (float_cmp, format_push_string)
- Apply rustfmt formatting fixes
@codecov-commenter
Copy link

codecov-commenter commented Dec 28, 2025

Codecov Report

❌ Patch coverage is 96.76674% with 28 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/feedparser-rs-core/src/parser/rss10.rs 6.25% 15 Missing ⚠️
crates/feedparser-rs-core/src/parser/rss.rs 95.57% 13 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #35      +/-   ##
==========================================
+ Coverage   91.55%   92.14%   +0.59%     
==========================================
  Files          33       34       +1     
  Lines        6616     7446     +830     
==========================================
+ Hits         6057     6861     +804     
- Misses        559      585      +26     
Flag Coverage Δ
rust-core 92.14% <96.76%> (+0.59%) ⬆️

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

Files with missing lines Coverage Δ
crates/feedparser-rs-core/src/compat/mod.rs 100.00% <100.00%> (ø)
crates/feedparser-rs-core/src/lib.rs 20.95% <ø> (ø)
crates/feedparser-rs-core/src/limits.rs 100.00% <100.00%> (ø)
crates/feedparser-rs-core/src/namespace/georss.rs 96.11% <100.00%> (+1.55%) ⬆️
...ates/feedparser-rs-core/src/namespace/media_rss.rs 97.69% <100.00%> (+3.57%) ⬆️
crates/feedparser-rs-core/src/parser/common.rs 77.63% <100.00%> (+0.29%) ⬆️
crates/feedparser-rs-core/src/types/common.rs 86.46% <ø> (ø)
crates/feedparser-rs-core/src/types/entry.rs 87.69% <ø> (ø)
crates/feedparser-rs-core/src/types/feed.rs 96.36% <ø> (ø)
crates/feedparser-rs-core/src/types/podcast.rs 100.00% <100.00%> (ø)
... and 2 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bug-ops bug-ops merged commit 2b973d2 into main Dec 28, 2025
31 checks passed
@bug-ops bug-ops deleted the feat/complete-namespace-support branch December 28, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: parser Feed parsing logic area: rss RSS 0.9x, 1.0, 2.0 support component: core feedparser-rs-core Rust library component: node Node.js bindings (napi-rs) component: python Python bindings (PyO3) component: tests Test suite or test infrastructure lang: rust Rust code size: XXL Huge PR (1000+ lines changed) type: tooling Development tools, CI/CD, or infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants