Fix Atom category attribute parsing - #64
Merged
Merged
Conversation
Read category terms from Atom attributes so scalar access, array collection, and category filtering agree. Preserve RSS text and CDATA while excluding nested categories and unusable Atom terms. Resolve namespaces from each entry's actual ancestors, including local overrides and resets. Share direct-child extraction with relation links and document the behavior in the README and changelog. Closes #56
houndci-bot
reviewed
Sep 13, 2026
Greptile SummaryThis PR updates category parsing to read Atom 1.0
Confidence Score: 5/5The PR appears safe to merge, with no concrete correctness, security, or independently actionable quality issue identified. The new parser preserves existing relation-link and RSS category behavior while adding focused Atom namespace and term handling backed by boundary and regression coverage. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Scan feed for item or entry] --> B[Resolve namespace context at entry position]
B --> C[Inspect configured item tags]
C -->|category| D[Tokenize direct child elements]
D --> E{Category namespace}
E -->|Atom 1.0| F[Read and normalize term attribute]
E -->|RSS namespace| G[Read element text or CDATA]
E -->|Foreign or undeclared prefix| H[Skip category]
F --> I[Apply scalar or array behavior]
G --> I
I --> J[Populate item category]
C -->|other tag| K[Use existing item-tag parser]
Reviews (1): Last reviewed commit: "fix: parse Atom category terms" | Re-trigger Greptile |
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.
Atom categories store their value in
term, but the parser read element text and lost ordinary self-closing categories. Read Atom 1.0 terms so scalarcategory,array_tags: [:category], anditems_by_categorywork together. Preserve source order and duplicates, skip missing or blank terms, and retain RSS category text, CDATA, and scalar/array behavior.Resolve default and prefixed namespaces at each entry's actual position in the feed, including local overrides and resets. Keep category extraction within direct children so nested content, source metadata, comments, and neighboring entries cannot supply a category. Reuse the existing link tokenizer for direct-child extraction while retaining relation-link behavior and zero additional runtime dependencies. Update the README and Unreleased changelog.
Validation: the initial regression failed with expected
["ruby", "rails"]and actualnil; it passes after the fix. Added separate failing regressions for namespace declarations in comments and namespace leakage from an RDF channel to sibling items. The full suite passes on Ruby 3.4.8 (136 tests, 310 assertions; 3 existing network-test omissions), along with RuboCop, RBS generation/validation, and Steep. Category values also match namespace-aware XML extraction for all three entries in the archived fork fixture.Review note: Hound reports single-quote style and test length/complexity limits from its defaults. The repository explicitly requires double quotes and excludes tests from those metrics in
.rubocop.yml; the configured CI lint check passes. Those conflicting Hound threads are resolved without changing the project conventions.Closes #56.