Add normalized RSS and Atom entries - #65
Conversation
Give RSS and Atom consumers one optional entry interface without changing raw items, serialization, or global tag configuration. Preserve source metadata and report normalization limits instead of inventing values. Track XML namespace and base scopes, keep attachment metadata associated, and support per-call content and keyword mappings. Retain the final fetch URL and resolve relative redirects so relative feed links have a base. Add equivalent format fixtures, boundary and HTTP regressions, a digest example, mapping documentation, and an Unreleased changelog entry. Closes #59.
Only collect Media RSS content from Media RSS groups. Nested RSS or Atom enclosures are not direct entry metadata and must not add attachments. Preserve an invalid attachment-specific duration as nil with its issue, rather than replacing it with a broader item-level iTunes duration. Add failing regressions for both cases and verify the complete suite.
|
@greptileai Please review the current head f1b0216 and provide an updated confidence score. The follow-up commit adds red/green regressions and fixes Media RSS group boundaries and invalid attachment-duration precedence. The full suite passes with 163 tests and 493 assertions, plus RuboCop, RBS validation, and Steep. Please assess the current commit, including the updated tests. |
Greptile SummaryAdds an immutable, format-independent normalized view over RSS and Atom entries while preserving the existing raw parsing and serialization interfaces.
Confidence Score: 5/5The PR appears safe to merge; both previous findings are fully addressed and no actionable new issue remains. Fetch parsing now merges the final response URL after caller options, so stale or nil Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
XML[RSS or Atom XML] --> Parser[Existing SimpleRSS parser]
Parser --> Raw[Raw items and serialization]
Parser --> Context[Entry XML and scoped namespace/base context]
Raw --> Normalizer[EntryNormalizer]
Context --> Normalizer
URL[Supplied or final fetched source URL] --> Normalizer
Mapping[Per-call mappings] --> Normalizer
Normalizer --> Entry[Immutable NormalizedEntry]
Reviews (3): Last reviewed commit: "fix: preserve the fetched source URL" | Re-trigger Greptile |
Make the final HTTP response URL authoritative even when shared parse options include a stale or nil source_url. Callers can still override the base explicitly when requesting a normalized view. Add a local HTTP regression proving both options preserve the final URL without mutation. Flatten content handling, duration validation, and author inheritance with guard clauses and focused helpers to follow the repository style rules.
|
@greptileai Please re-review the current head 80e5146 and update the confidence score. Both findings are addressed: fetch now always retains the final response URL, with a failing-then-passing local HTTP regression for stale and nil source_url options; content handling, duration validation, and author fallback now use guard clauses and focused helpers. The attachment boundary fixes remain included. Full suite: 164 tests, 502 assertions, 3 existing network omissions. RuboCop, RBS generation/validation, and Steep pass. |
Applications currently need format-specific branches to extract an article URL, content, dates, categories, and attachments. Add
feed.normalized_entries, an optional immutable RSS/Atom view, so one importer or digest can consume those fields. Keep existing raw items, custom tags, serialization, merge/diff identity, and date helpers compatible.xml:baseand a supplied or fetched source URL. Fetch retains the final URL and resolves relative redirects while preserving conditional GET behavior.full-textand explicit keyword mappings, plus Atom author inheritance.The same consumer works with RSS or Atom XML:
For an Atom entry with a self/API link and an HTML alternate,
entry.urlselects the HTML alternate. RSS item links map to the same field. Relative references use the applicable base URL, publication and update times stay separate, and summaries remain separate from full content.Custom full-text and keyword mappings apply to one call without modifying global tags:
rawis an immutable snapshot of the existing item hash;raw_xmlretains unconfigured extensions.field_sourcesidentifies the selected source tags,category_detailsretains labels/schemes and duplicates, andissuesexposes invalid or unsupported values.Fetching supplies the final response URL automatically, including after redirects:
The safe navigation preserves the existing
nilresult for HTTP 304. The runnable digest example produces identical output for the equivalent RSS and Atom fixtures:Validation: the initial public API tests failed before implementation. Additional red/green regressions cover XML comments leaking into text, Atom author inheritance, prefixed XHTML, content media-type parameters, Media RSS group boundaries, and invalid attachment-duration precedence. The complete Ruby 3.4.8 suite passes with 164 tests and 502 assertions (3 existing network-test omissions), alongside RuboCop, RBS generation/validation, and Steep. Local HTTP fixtures cover relative redirects, final URL resolution, conditional 304 responses, source-URL precedence with shared options, and request counts. Equivalent RSS/Atom fixtures produce identical digest output; the built gem loads and normalizes successfully, and the Rake package includes all new library/example files. Article URLs and category/subject collections match independent namespace-aware XML extraction for all three entries in the archived fork fixture.
Normalization is tolerant extraction, not standards validation or HTML sanitization. Relative values without a usable base and unsupported content remain inspectable; normalization does not fetch external content. JSON Feed parsing and website discovery remain separate issues (#60 and #61).
Review note: Hound uses defaults that conflict with this repository's
.rubocop.yml: the project requires double quotes, allows 160 columns and larger parser methods, disables class-documentation/magic-comment/expanded-class-style rules, and excludes Rakefile. All reported metric values are within the configured limits. The configured CI lint check passes; those conflicting Hound threads are resolved without changing project conventions.Closes #59.