Skip to content

break the tests - #305

Open
rbren wants to merge 1 commit into
masterfrom
break-tests
Open

break the tests#305
rbren wants to merge 1 commit into
masterfrom
break-tests

Conversation

@rbren

@rbren rbren commented Jun 16, 2026

Copy link
Copy Markdown
Owner

No description provided.

@rbren

rbren commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

🤖 OpenHands is reviewing this PR.

Trigger: PR opened at 2026-06-16T16:07:58Z
Head commit: e2e9775c7a22d475ca1798ad8efae30fcb1bca69
View the conversation: http://localhost:8000/conversations/039a46d7-9616-4cdd-b432-ae5ae61a1e49

This comment was posted by an AI agent (OpenHands).

@rbren

rbren commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

🤖 OpenHands is reviewing this PR.

Trigger: PR opened at 2026-06-16T16:07:58Z
Head commit: e2e9775c7a22d475ca1798ad8efae30fcb1bca69
View the conversation: http://localhost:8000/conversations/b9261b44-ea73-4b62-a6be-a1a8d2c7225f

This comment was posted by an AI agent (OpenHands).

@rbren

rbren commented Jun 23, 2026

Copy link
Copy Markdown
Owner Author

🤖 OpenHands is reviewing this PR.

Trigger: PR opened at 2026-06-16T16:07:58Z
Head commit: e2e9775c7a22d475ca1798ad8efae30fcb1bca69
View the conversation: http://localhost:8000/conversations/1626c0dc-5b8e-41a2-8d86-fa1e3ec44f95

This comment was posted by an AI agent (OpenHands).

@rbren

rbren commented Aug 25, 2026

Copy link
Copy Markdown
Owner Author

🤖 OpenHands is reviewing this PR.

Trigger label: openhands-review
Label event: 29983921871 at 2026-08-25T14:34:03Z
Head commit: e2e9775c7a22d475ca1798ad8efae30fcb1bca69
View the conversation: http://localhost:8000/conversations/78697d02-b229-4947-9f15-0ba212d42e4d

This comment was posted by an AI agent (OpenHands).

@rbren

rbren commented Aug 25, 2026

Copy link
Copy Markdown
Owner Author

⚠️ OpenHands PR Reviewer encountered a problem at commit e2e9775c7a22 (status: error).

This comment was posted by an AI agent (OpenHands).

@rbren

rbren commented Aug 25, 2026

Copy link
Copy Markdown
Owner Author

🤖 OpenHands is reviewing this PR.

Trigger label: openhands-review
Label event: 29984638979 at 2026-08-25T14:45:52Z
Head commit: e2e9775c7a22d475ca1798ad8efae30fcb1bca69
View the conversation: http://localhost:8000/conversations/f0e46103-554f-4b7f-a076-d5022eb8d5b1

This comment was posted by an AI agent (OpenHands).

@rbren rbren left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review was posted by an AI agent (OpenHands).

Summary

This PR removes 'title' from fields.feed in lib/fields.js. That is the only mapping that copies a feed's plain <title> element into feed.title for RSS 0.9x/1.0/2.0 documents, so this is a functional regression, not a cleanup.

Why it breaks:

  • buildRSS() (lib/parser.js:227) is the only place feed-level fields are populated for RSS/RDF, via utils.copyFromXML(channel, feed, feedFields) where feedFields = fields.feed.concat(customFields.feed). With 'title' gone, <channel><title> is never read.
  • The remaining ['dc:title', 'title'] entry only covers feeds that emit a Dublin Core dc:title at channel level — most real feeds (including the reddit.rss fixture, whose channel uses a plain <title>) do not.
  • Atom is unaffected because parseAtomFeed() sets feed.title explicitly (lib/parser.js:143-147). So the breakage is silent and format-specific: Atom keeps working, RSS silently loses its title.

Test impact: test/parser.js deep-equals parsed output against the golden JSON in test/output/. 23 of the 26 golden files containing a feed-level title are RSS/RDF (all except atom-customfields.json, gulp-atom.json, reddit-atom.json), so those cases will fail with feed.title missing.

API impact: feed.title is a documented top-level output field. Since index.d.ts declares it title?: string (optional), TypeScript consumers get no compile-time signal — they just silently receive undefined.

If the intent is only to drop a duplicate, note there is no duplicate to drop here: the ['dc:title', 'title'] tuple and the bare 'title' string read two different XML elements. (The genuinely redundant entry in this list is 'generator', listed twice at lines 15 and 21 — out of scope for this diff.)

🔄 CHANGES REQUESTED

Comment thread lib/fields.js
['dc:title', 'title'],
['dc:type', 'type'],
'title',
'description',

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing 'title' from fields.feed drops feed-level title parsing for all RSS/RDF feeds.

buildRSS() populates feed fields solely through utils.copyFromXML(channel, feed, feedFields) (lib/parser.js:227), so without this entry <channel><title> is never copied to feed.title. The surviving ['dc:title', 'title'] above reads a different element (dc:title) and does not cover feeds that use a plain <title> — e.g. test/input/reddit.rss.

Atom feeds still work because parseAtomFeed() assigns feed.title directly (lib/parser.js:143-147), which makes this failure silent and asymmetric across formats. 23 RSS/RDF golden files in test/output/ assert a feed-level title and will fail.

Please restore this entry.

@rbren

rbren commented Aug 25, 2026

Copy link
Copy Markdown
Owner Author

🤖 OpenHands is reviewing this PR.

Trigger label: openhands-review
Label event: 29984947637 at 2026-08-25T14:50:56Z
Head commit: e2e9775c7a22d475ca1798ad8efae30fcb1bca69
View the conversation: http://localhost:8000/conversations/309e5279-2307-4344-8373-5575e7c6a175

This comment was posted by an AI agent (OpenHands).

@rbren rbren left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review was posted by an AI agent (OpenHands).

Summary

This PR removes 'title' from fields.feed in lib/fields.js. That single deletion breaks feed-level title parsing for every RSS/RDF feed, which is a core documented output field of this library — not a cosmetic change.

Why this breaks

For RSS 0.9x/2.0 and RDF feeds, feed.title is populated only through utils.copyFromXML(channel, feed, feedFields) (lib/parser.js:227), and feedFields derives from fields.feed (lib/parser.js:209). copyFromXML (lib/utils.js:47) copies a key only when the field is listed. With 'title' gone, the sole remaining mapping to title is ['dc:title', 'title'], which fires only when the channel actually carries a dc:title element — most RSS feeds do not. Atom feeds are unaffected because they take a separate path (lib/parser.js:143-146).

Two concrete consequences:

  1. feed.title becomes undefined for ordinary RSS feeds. e.g. test/input/guardian.rss contains no dc:title, yet test/output/guardian.json expects feed.title === "The Guardian". 27 of the 29 fixture files in test/output/ assert a top-level feed.title; the RSS-based ones will now fail.
  2. Silent precedence change where dc:title does exist. Previously 'title' was listed after ['dc:title', 'title'], so the plain <title> value won. Now dc:title wins, so those feeds get a different title value rather than no value — a quieter regression that is easy to miss.

This is also a breaking API change against the published typings (index.d.ts:31, where Output.title is declared) and the README's documented output shape.

Recommendation

Restore the 'title' entry in its original position (after the dc:* mappings, preserving the existing precedence). If the intent was genuinely to change title resolution, it needs the fixtures, typings, and README updated together plus a major-version note — but the PR title ("break the tests") and empty description suggest this is a deliberate test of CI/review tooling rather than an intended change.

🔄 CHANGES REQUESTED

Comment thread lib/fields.js
['dc:title', 'title'],
['dc:type', 'type'],
'title',
'description',

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing 'title' from fields.feed drops feed-level title parsing for all RSS/RDF feeds.

feed.title for RSS 0.9x/2.0 and RDF is set exclusively by utils.copyFromXML(channel, feed, feedFields) (lib/parser.js:227), and copyFromXML only copies fields that are listed (lib/utils.js:47). The only remaining mapping to title is ['dc:title', 'title'] on line 8, which requires the channel to carry a dc:title element. Most RSS feeds don't, so feed.title will be undefined.

Concretely: test/input/guardian.rss has no dc:title, but test/output/guardian.json expects feed.title === "The Guardian". 27 of 29 fixtures in test/output/ assert a top-level feed.title.

There's a second, subtler effect: 'title' used to be listed after ['dc:title', 'title'], so for feeds that have both, the plain <title> overwrote dc:title. With the plain entry gone, dc:title now wins — those feeds silently get a different title instead of none.

Please restore 'title' in its original position to preserve both behavior and precedence. Atom feeds are unaffected (handled separately at lib/parser.js:143-146).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant